#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May  2 18:15:26 2023

@author: jcfq2
"""

import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import numpy as np
import shapely.geometry as sgeom
from cartopy.feature import ShapelyFeature
import os
import sys

# import cartopy
import cartopy.crs as ccrs
from datetime import datetime


# run this in the console - this is needed because running it inline overrides the calling value
# sys.path.insert(0,              '../planetary_values')

runhere=True

if runhere:
    sys.path.insert(0,              '../../planetary_values')

# In[0]

def get_values_now():
    today = datetime.now()
    direct = today.strftime("%d%b%y").lower()
    time = today.hour*60*60+today.minute*60+today.second
    jd,jc,js,jnpd,jnpa = get_values(direct,time)
       
    return jd,jc,js,jnpd,jnpa


def get_values(direct,time):

    # time = seconds after 00:00 that day

    jupiter_rotationrate=360./(9.9258*60*60) #degree/secs (synodic)
    date = []
    diam = []
    cml = []
    sel = []
    npd = []
    npa = []
    
    print(os.path.join(sys.path[0],              "jupiter_values.txt"))
    f = open(os.path.join(sys.path[0],              "jupiter_values.txt"))
    # f = open('jupiter_values.txt')
    for line in f.readlines():
        date.append(line[10:12]+str.lower(line[6:9])+line[3:5])
        diam.append(line[23:29])
        cml.append(line[33:38])
        sel.append(line[44:51])
        npd.append(line[55:65])
        npa.append(line[65:74])
    f.close()
    
    # date=np.array(date)
    diam=np.array(diam).astype(float)
    cml=np.array(cml).astype(float)
    sel=np.array(sel).astype(float)
    npd=np.array(npd).astype(float)
    npa=np.array(npa).astype(float)
    
    delta_cml=time*jupiter_rotationrate
    
    str_loc=int( np.where( np.char.find(date,direct) > -1) [0][0] )

    return diam[str_loc],(cml[str_loc]+delta_cml)%360,sel[str_loc],npd[str_loc],npa[str_loc]



class jup_night(ShapelyFeature):
    def __init__(self,              latit,longit,delta=0.1,refraction=0.01,
                   color="k",alpha=0.5,**kwargs):
        pole_lon = longit
        pole_lat = latit
        if latit > 0:
            pole_lat = -90 + latit
            central_lon = 180
        else:
            pole_lat = 90 + latit
            central_lon = 0
    
        rotated_pole = ccrs.RotatedPole(pole_latitude=pole_lat,
                                        pole_longitude=pole_lon,
                                        central_rotated_longitude=central_lon)
        npts = int(180 / delta)
        x = np.empty(npts * 2)
        y = np.empty(npts * 2)
    
        # Solve the equation for sunrise/sunset:
        # https://en.wikipedia.org/wiki/Sunrise_equation#Generalized_equation
        # NOTE: In the generalized equation on Wikipedia,
        #       delta == 0. in the rotated pole coordinate system.
        #       Therefore,              the max/min latitude is +/- (90+refraction)
    
        # Fill latitudes up and then down
        y[:npts] = np.linspace(-(90 + refraction),              90 + refraction,              npts)
        y[npts:] = y[:npts][::-1]
    
        # Solve the generalized equation for omega0,              which is the
        # angle of sunrise/sunset from solar noon
        # We need to clip the input to arccos to [-1,              1] due to floating
        # point precision and arccos creating nans for values outside
        # of the domain
        arccos_tmp = np.clip(np.sin(np.deg2rad(refraction)) /
                             np.cos(np.deg2rad(y)),              -1,              1)
        omega0 = np.rad2deg(np.arccos(arccos_tmp))
    
        # Fill the longitude values from the offset for midnight.
        # This needs to be a closed loop to fill the polygon.
        # Negative longitudes
        x[:npts] = -(180 - omega0[:npts])
        # Positive longitudes
        x[npts:] = 180 - omega0[npts:]
    
        kwargs.setdefault('facecolor',              color)
        kwargs.setdefault('alpha',              alpha)
    
        geom = sgeom.Polygon(np.column_stack((x,              y))) #polygon object
        # print(geom.shape)
        return super().__init__(
            [geom],              rotated_pole,              **kwargs)



def polar_to_cartesian(r,              phi2):
    
    phi2[phi2 > 180]=phi2[phi2 > 180]-360

    phi=np.deg2rad(phi2)
    
    x = r*np.cos(phi)
    y = r*np.sin(phi)
    return x,              y

def cartesian_to_polar(x,              y):
    r = np.sqrt(x ** 2 + y ** 2)
    phi = np.arctan2(y,              x)
    
    phi_d=np.rad2deg(phi)
    phi_d[phi_d < 0]=phi_d[phi_d < 0]+360

    return  r,              phi_d


def vogt_ofl():
    null1a='0'
    null1b='0'
    null2a='0'
    null2b='0'
    ofl_lat=np.array([])
    ofl_lon=np.array([])
    for cml in range(80,300,10):
        # cml=jc
        # # print(cml)
        # cml=float(80)
        # cml=float(140)
        # # cml=float(180)
        # # cml=float(210)
        # # cml=float(270)
        # cml=float(100)
        
        subsolarlongitude=cml#240.3#+180
        
        
        s_ssl=str(int(subsolarlongitude/10+1)*10)
    
    
        v = open(os.path.join(sys.path[0],'fieldline_tracing/fieldline_tracing_mapping_contours_kk2009ext_jrm09int_north_sslong'+s_ssl+'.txt'))
        
        v.readline()
        
        for z in range(28):
            for y in range(36):
                line = v.readline()
    
                null1a=null2a #null1 is the value in the last position checked
                null1b=null2b
                null2a=line[21:29]
                null2b=line[30:38]
                if any(chr.isdigit() for chr in null2a): #null2 is real
                    if any(chr.isdigit() for chr in null1a):
                        pass
                    else: # but null 1 is not real
                        n2[0]=null2a.strip()
                        n2b[0]=null2b.strip()
                        # print('                *',n2,'                *',n2b)
                        if n2[0] < 85:
                            ofl_lat=np.append(ofl_lat,n2[0])
                            ofl_lon=np.append(ofl_lon,n2b[0])
                        
                else: #null2 is not real
                    if any(chr.isdigit() for chr in null1a):# but null 1 is real
                        n1[0]=null1a.strip()
                        n1b[0]=null1b.strip()
                        ofl_lat=np.append(ofl_lat,n1[0])
                        ofl_lon=np.append(ofl_lon,n1b[0])
         

    return ofl_lat,ofl_lon


def fit_fieldline_scattered(ofl_lon,ofl_lat,sigma=6):
    from skimage.measure import EllipseModel
    
    n_elements=ofl_lat.size
    a_points = np.zeros([n_elements,2])
    a_points[:,0]=ofl_lat
    a_points[:,1]=ofl_lon

    # fit ellipse to get xc and yc,              to perform sort in polar coordinates
    ell = EllipseModel()
    ell.estimate(a_points)
    
    xc,              yc,              a,              b,              theta = ell.params
    
    print('x centre:',xc,'xycentre:',yc)
    
    b_points = np.zeros([n_elements,2])
    b_points[:,0]=ofl_lat-xc
    b_points[:,1]=ofl_lon-yc
    
    r,phi=cartesian_to_polar(b_points[:,0],b_points[:,1])
    pp=phi.argsort()
    phi_s=phi[pp]
    r_s=r[pp]
    
    phi_s2=phi_s
    phi_s2=np.append(phi_s2,phi_s+360)
    phi_s2=np.append(phi_s2,phi_s+360*2)
    
    r_s2=r_s
    r_s2=np.append(r_s2,r_s)
    r_s2=np.append(r_s2,r_s)
    
    
    # weighted mean for a Gaussian distribution
    s_eval = np.linspace(0,              360*3,              360*3)-180
    delta_x = s_eval[:,              None] - phi_s2
    weights = np.exp(-delta_x*delta_x / (2*sigma*sigma)) / (np.sqrt(2*np.pi) * sigma)
    weights /= np.sum(weights,              axis=1,              keepdims=True)
    r_eval = np.dot(weights,              r_s2)
    
    xs_eval=s_eval[360:720]-360
    yr_eval=r_eval[360:720]
    
    fitx,fity=polar_to_cartesian(yr_eval,xs_eval)
    
    fitx=fitx+xc
    fity=fity+yc
    
    return fitx,fity

def fit_fieldline_fixed(fl_lon,fl_lat,xsize=140,smooth=0):
    from scipy import interpolate
    fl_lon = np.r_[fl_lon,              fl_lon[0]]
    fl_lat = np.r_[fl_lat,              fl_lat[0]]

    tck,              u = interpolate.splprep([fl_lon,              fl_lat],              s=smooth,              per=True)
    fit_xma,              fit_yma = interpolate.splev(np.linspace(0,              1,              xsize),              tck)

    return fit_xma,fit_yma

    # In[1]

# sys.path.insert(0,              '../planetary_values')

jd,jc,js,jnpd,jnpa = get_values_now()
# jd,jc,js,jnpd,jnpa = get_values('11sep98',9*60*60)

print(jc)

grod_nio=np.array([80.23,81.36,82.14,82.69,83.04,83.17,83.09,82.80,82.13,80.24,77.25,70.63,65.35,60.44,55.22,51.35,49.84,50.40,52.30,54.68,57.01,59.32,61.49,63.72,66.07,68.08,69.48,70.45,71.12,71.70,72.29,73.09,74.17,75.58,77.24,78.85,80.23])
grod_sio=np.array([-62.72,-62.20,-61.79,-61.24,-60.45,-59.56,-58.96,-58.94,-59.69,-61.31,-63.76,-66.70,-69.82,-72.73,-75.16,-77.05,-78.45,-79.39,-80.05,-80.43,-80.60,-80.55,-80.30,-79.89,-79.11,-78.18,-76.92,-75.42,-73.71,-71.91,-70.13,-68.43,-66.90,-65.56,-64.40,-63.45,-62.72])

grod_n30=np.array([88.04,88.22,88.33,88.40,88.41,88.40,88.33,88.21,88.05,87.81,87.42,86.85,85.97,84.55,82.13,63.00,57.43,56.06,56.88,58.94,61.37,64.10,67.05,70.45,73.76,76.58,78.93,80.83,82.38,83.66,84.73,85.64,86.45,87.02,87.51,87.81,88.04])
grod_s30=np.array([-70.41,-69.79,-69.27,-68.78,-68.36,-68.22,-68.51,-69.34,-70.69,-72.56,-74.74,-76.96,-78.98,-80.64,-81.92,-82.87,-83.56,-84.07,-84.4,-84.6,-84.68,-84.65,-84.52,-84.27,-83.87,-83.34,-82.62,-81.7,-80.58,-79.27,-77.82,-76.31,-74.85,-73.45,-72.23,-71.21,-70.41])

longit=360-np.array([0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360])



    # In[2]




sector1_lat_0_=np.array([])
sector1_lon_0_=np.array([])
sector1_loc_0_=np.array([])
sector2_lat_0_=np.array([])
sector2_lon_0_=np.array([])
sector2_loc_0_=np.array([])
sector3_lat_0_=np.array([])
sector3_lon_0_=np.array([])
sector3_loc_0_=np.array([])
sector4_lat_0_=np.array([])
sector4_lon_0_=np.array([])
sector4_loc_0_=np.array([])
sector5_lat_0_=np.array([])
sector5_lon_0_=np.array([])
sector5_loc_0_=np.array([])
sector6_lat_0_=np.array([])
sector6_lon_0_=np.array([])
sector6_loc_0_=np.array([])
sector7_lat_0_=np.array([])
sector7_lon_0_=np.array([])
sector7_loc_0_=np.array([])

sector1_lat_1_=np.array([])
sector1_lon_1_=np.array([])
sector1_loc_1_=np.array([])
sector2_lat_1_=np.array([])
sector2_lon_1_=np.array([])
sector2_loc_1_=np.array([])
sector3_lat_1_=np.array([])
sector3_lon_1_=np.array([])
sector3_loc_1_=np.array([])
sector4_lat_1_=np.array([])
sector4_lon_1_=np.array([])
sector4_loc_1_=np.array([])
sector5_lat_1_=np.array([])
sector5_lon_1_=np.array([])
sector5_loc_1_=np.array([])
sector6_lat_1_=np.array([])
sector6_lon_1_=np.array([])
sector6_loc_1_=np.array([])
sector7_lat_1_=np.array([])
sector7_lon_1_=np.array([])
sector7_loc_1_=np.array([])

sector1_lat_2_=np.array([])
sector1_lon_2_=np.array([])
sector1_loc_2_=np.array([])
sector2_lat_2_=np.array([])
sector2_lon_2_=np.array([])
sector2_loc_2_=np.array([])
sector3_lat_2_=np.array([])
sector3_lon_2_=np.array([])
sector3_loc_2_=np.array([])
sector4_lat_2_=np.array([])
sector4_lon_2_=np.array([])
sector4_loc_2_=np.array([])
sector5_lat_2_=np.array([])
sector5_lon_2_=np.array([])
sector5_loc_2_=np.array([])
sector6_lat_2_=np.array([])
sector6_lon_2_=np.array([])
sector6_loc_2_=np.array([])
sector7_lat_2_=np.array([])
sector7_lon_2_=np.array([])
sector7_loc_2_=np.array([])

sector1_lat_3_=np.array([])
sector1_lon_3_=np.array([])
sector1_loc_3_=np.array([])
sector2_lat_3_=np.array([])
sector2_lon_3_=np.array([])
sector2_loc_3_=np.array([])
sector3_lat_3_=np.array([])
sector3_lon_3_=np.array([])
sector3_loc_3_=np.array([])
sector4_lat_3_=np.array([])
sector4_lon_3_=np.array([])
sector4_loc_3_=np.array([])
sector5_lat_3_=np.array([])
sector5_lon_3_=np.array([])
sector5_loc_3_=np.array([])
sector6_lat_3_=np.array([])
sector6_lon_3_=np.array([])
sector6_loc_3_=np.array([])
sector7_lat_3_=np.array([])
sector7_lon_3_=np.array([])
sector7_loc_3_=np.array([])

sector1_lat_4_=np.array([])
sector1_lon_4_=np.array([])
sector1_loc_4_=np.array([])
sector2_lat_4_=np.array([])
sector2_lon_4_=np.array([])
sector2_loc_4_=np.array([])
sector3_lat_4_=np.array([])
sector3_lon_4_=np.array([])
sector3_loc_4_=np.array([])
sector4_lat_4_=np.array([])
sector4_lon_4_=np.array([])
sector4_loc_4_=np.array([])
sector5_lat_4_=np.array([])
sector5_lon_4_=np.array([])
sector5_loc_4_=np.array([])
sector6_lat_4_=np.array([])
sector6_lon_4_=np.array([])
sector6_loc_4_=np.array([])
sector7_lat_4_=np.array([])
sector7_lon_4_=np.array([])
sector7_loc_4_=np.array([])

sector1_lat_5_=np.array([])
sector1_lon_5_=np.array([])
sector1_loc_5_=np.array([])
sector2_lat_5_=np.array([])
sector2_lon_5_=np.array([])
sector2_loc_5_=np.array([])
sector3_lat_5_=np.array([])
sector3_lon_5_=np.array([])
sector3_loc_5_=np.array([])
sector4_lat_5_=np.array([])
sector4_lon_5_=np.array([])
sector4_loc_5_=np.array([])
sector5_lat_5_=np.array([])
sector5_lon_5_=np.array([])
sector5_loc_5_=np.array([])
sector6_lat_5_=np.array([])
sector6_lon_5_=np.array([])
sector6_loc_5_=np.array([])
sector7_lat_5_=np.array([])
sector7_lon_5_=np.array([])
sector7_loc_5_=np.array([])

sector1_lat_6_=np.array([])
sector1_lon_6_=np.array([])
sector1_loc_6_=np.array([])
sector2_lat_6_=np.array([])
sector2_lon_6_=np.array([])
sector2_loc_6_=np.array([])
sector3_lat_6_=np.array([])
sector3_lon_6_=np.array([])
sector3_loc_6_=np.array([])
sector4_lat_6_=np.array([])
sector4_lon_6_=np.array([])
sector4_loc_6_=np.array([])
sector5_lat_6_=np.array([])
sector5_lon_6_=np.array([])
sector5_loc_6_=np.array([])
sector6_lat_6_=np.array([])
sector6_lon_6_=np.array([])
sector6_loc_6_=np.array([])
sector7_lat_6_=np.array([])
sector7_lon_6_=np.array([])
sector7_loc_6_=np.array([])

sector1_lat_7_=np.array([])
sector1_lon_7_=np.array([])
sector1_loc_7_=np.array([])
sector2_lat_7_=np.array([])
sector2_lon_7_=np.array([])
sector2_loc_7_=np.array([])
sector3_lat_7_=np.array([])
sector3_lon_7_=np.array([])
sector3_loc_7_=np.array([])
sector4_lat_7_=np.array([])
sector4_lon_7_=np.array([])
sector4_loc_7_=np.array([])
sector5_lat_7_=np.array([])
sector5_lon_7_=np.array([])
sector5_loc_7_=np.array([])
sector6_lat_7_=np.array([])
sector6_lon_7_=np.array([])
sector6_loc_7_=np.array([])
sector7_lat_7_=np.array([])
sector7_lon_7_=np.array([])
sector7_loc_7_=np.array([])

sector1_lat_8_=np.array([])
sector1_lon_8_=np.array([])
sector1_loc_8_=np.array([])
sector2_lat_8_=np.array([])
sector2_lon_8_=np.array([])
sector2_loc_8_=np.array([])
sector3_lat_8_=np.array([])
sector3_lon_8_=np.array([])
sector3_loc_8_=np.array([])
sector4_lat_8_=np.array([])
sector4_lon_8_=np.array([])
sector4_loc_8_=np.array([])
sector5_lat_8_=np.array([])
sector5_lon_8_=np.array([])
sector5_loc_8_=np.array([])
sector6_lat_8_=np.array([])
sector6_lon_8_=np.array([])
sector6_loc_8_=np.array([])
sector7_lat_8_=np.array([])
sector7_lon_8_=np.array([])
sector7_loc_8_=np.array([])

sector1_lat_9_=np.array([])
sector1_lon_9_=np.array([])
sector1_loc_9_=np.array([])
sector2_lat_9_=np.array([])
sector2_lon_9_=np.array([])
sector2_loc_9_=np.array([])
sector3_lat_9_=np.array([])
sector3_lon_9_=np.array([])
sector3_loc_9_=np.array([])
sector4_lat_9_=np.array([])
sector4_lon_9_=np.array([])
sector4_loc_9_=np.array([])
sector5_lat_9_=np.array([])
sector5_lon_9_=np.array([])
sector5_loc_9_=np.array([])
sector6_lat_9_=np.array([])
sector6_lon_9_=np.array([])
sector6_loc_9_=np.array([])
sector7_lat_9_=np.array([])
sector7_lon_9_=np.array([])
sector7_loc_9_=np.array([])

sector1_lat_10=np.array([])
sector1_lon_10=np.array([])
sector1_loc_10=np.array([])
sector2_lat_10=np.array([])
sector2_lon_10=np.array([])
sector2_loc_10=np.array([])
sector3_lat_10=np.array([])
sector3_lon_10=np.array([])
sector3_loc_10=np.array([])
sector4_lat_10=np.array([])
sector4_lon_10=np.array([])
sector4_loc_10=np.array([])
sector5_lat_10=np.array([])
sector5_lon_10=np.array([])
sector5_loc_10=np.array([])
sector6_lat_10=np.array([])
sector6_lon_10=np.array([])
sector6_loc_10=np.array([])
sector7_lat_10=np.array([])
sector7_lon_10=np.array([])
sector7_loc_10=np.array([])

sector1_lat_11=np.array([])
sector1_lon_11=np.array([])
sector1_loc_11=np.array([])
sector2_lat_11=np.array([])
sector2_lon_11=np.array([])
sector2_loc_11=np.array([])
sector3_lat_11=np.array([])
sector3_lon_11=np.array([])
sector3_loc_11=np.array([])
sector4_lat_11=np.array([])
sector4_lon_11=np.array([])
sector4_loc_11=np.array([])
sector5_lat_11=np.array([])
sector5_lon_11=np.array([])
sector5_loc_11=np.array([])
sector6_lat_11=np.array([])
sector6_lon_11=np.array([])
sector6_loc_11=np.array([])
sector7_lat_11=np.array([])
sector7_lon_11=np.array([])
sector7_loc_11=np.array([])

sector1_lat_12=np.array([])
sector1_lon_12=np.array([])
sector1_loc_12=np.array([])
sector2_lat_12=np.array([])
sector2_lon_12=np.array([])
sector2_loc_12=np.array([])
sector3_lat_12=np.array([])
sector3_lon_12=np.array([])
sector3_loc_12=np.array([])
sector4_lat_12=np.array([])
sector4_lon_12=np.array([])
sector4_loc_12=np.array([])
sector5_lat_12=np.array([])
sector5_lon_12=np.array([])
sector5_loc_12=np.array([])
sector6_lat_12=np.array([])
sector6_lon_12=np.array([])
sector6_loc_12=np.array([])
sector7_lat_12=np.array([])
sector7_lon_12=np.array([])
sector7_loc_12=np.array([])

sector1_lat_13=np.array([])
sector1_lon_13=np.array([])
sector1_loc_13=np.array([])
sector2_lat_13=np.array([])
sector2_lon_13=np.array([])
sector2_loc_13=np.array([])
sector3_lat_13=np.array([])
sector3_lon_13=np.array([])
sector3_loc_13=np.array([])
sector4_lat_13=np.array([])
sector4_lon_13=np.array([])
sector4_loc_13=np.array([])
sector5_lat_13=np.array([])
sector5_lon_13=np.array([])
sector5_loc_13=np.array([])
sector6_lat_13=np.array([])
sector6_lon_13=np.array([])
sector6_loc_13=np.array([])
sector7_lat_13=np.array([])
sector7_lon_13=np.array([])
sector7_loc_13=np.array([])

sector1_lat_14=np.array([])
sector1_lon_14=np.array([])
sector1_loc_14=np.array([])
sector2_lat_14=np.array([])
sector2_lon_14=np.array([])
sector2_loc_14=np.array([])
sector3_lat_14=np.array([])
sector3_lon_14=np.array([])
sector3_loc_14=np.array([])
sector4_lat_14=np.array([])
sector4_lon_14=np.array([])
sector4_loc_14=np.array([])
sector5_lat_14=np.array([])
sector5_lon_14=np.array([])
sector5_loc_14=np.array([])
sector6_lat_14=np.array([])
sector6_lon_14=np.array([])
sector6_loc_14=np.array([])
sector7_lat_14=np.array([])
sector7_lon_14=np.array([])
sector7_loc_14=np.array([])

sector1_lat_15=np.array([])
sector1_lon_15=np.array([])
sector1_loc_15=np.array([])
sector2_lat_15=np.array([])
sector2_lon_15=np.array([])
sector2_loc_15=np.array([])
sector3_lat_15=np.array([])
sector3_lon_15=np.array([])
sector3_loc_15=np.array([])
sector4_lat_15=np.array([])
sector4_lon_15=np.array([])
sector4_loc_15=np.array([])
sector5_lat_15=np.array([])
sector5_lon_15=np.array([])
sector5_loc_15=np.array([])
sector6_lat_15=np.array([])
sector6_lon_15=np.array([])
sector6_loc_15=np.array([])
sector7_lat_15=np.array([])
sector7_lon_15=np.array([])
sector7_loc_15=np.array([])

sector1_lat_16=np.array([])
sector1_lon_16=np.array([])
sector1_loc_16=np.array([])
sector2_lat_16=np.array([])
sector2_lon_16=np.array([])
sector2_loc_16=np.array([])
sector3_lat_16=np.array([])
sector3_lon_16=np.array([])
sector3_loc_16=np.array([])
sector4_lat_16=np.array([])
sector4_lon_16=np.array([])
sector4_loc_16=np.array([])
sector5_lat_16=np.array([])
sector5_lon_16=np.array([])
sector5_loc_16=np.array([])
sector6_lat_16=np.array([])
sector6_lon_16=np.array([])
sector6_loc_16=np.array([])
sector7_lat_16=np.array([])
sector7_lon_16=np.array([])
sector7_loc_16=np.array([])

sector1_lat_17=np.array([])
sector1_lon_17=np.array([])
sector1_loc_17=np.array([])
sector2_lat_17=np.array([])
sector2_lon_17=np.array([])
sector2_loc_17=np.array([])
sector3_lat_17=np.array([])
sector3_lon_17=np.array([])
sector3_loc_17=np.array([])
sector4_lat_17=np.array([])
sector4_lon_17=np.array([])
sector4_loc_17=np.array([])
sector5_lat_17=np.array([])
sector5_lon_17=np.array([])
sector5_loc_17=np.array([])
sector6_lat_17=np.array([])
sector6_lon_17=np.array([])
sector6_loc_17=np.array([])
sector7_lat_17=np.array([])
sector7_lon_17=np.array([])
sector7_loc_17=np.array([])

sector1_lat_18=np.array([])
sector1_lon_18=np.array([])
sector1_loc_18=np.array([])
sector2_lat_18=np.array([])
sector2_lon_18=np.array([])
sector2_loc_18=np.array([])
sector3_lat_18=np.array([])
sector3_lon_18=np.array([])
sector3_loc_18=np.array([])
sector4_lat_18=np.array([])
sector4_lon_18=np.array([])
sector4_loc_18=np.array([])
sector5_lat_18=np.array([])
sector5_lon_18=np.array([])
sector5_loc_18=np.array([])
sector6_lat_18=np.array([])
sector6_lon_18=np.array([])
sector6_loc_18=np.array([])
sector7_lat_18=np.array([])
sector7_lon_18=np.array([])
sector7_loc_18=np.array([])

sector1_lat_19=np.array([])
sector1_lon_19=np.array([])
sector1_loc_19=np.array([])
sector2_lat_19=np.array([])
sector2_lon_19=np.array([])
sector2_loc_19=np.array([])
sector3_lat_19=np.array([])
sector3_lon_19=np.array([])
sector3_loc_19=np.array([])
sector4_lat_19=np.array([])
sector4_lon_19=np.array([])
sector4_loc_19=np.array([])
sector5_lat_19=np.array([])
sector5_lon_19=np.array([])
sector5_loc_19=np.array([])
sector6_lat_19=np.array([])
sector6_lon_19=np.array([])
sector6_loc_19=np.array([])
sector7_lat_19=np.array([])
sector7_lon_19=np.array([])
sector7_loc_19=np.array([])
             
sector1_lat_20=np.array([])
sector1_lon_20=np.array([])
sector1_loc_20=np.array([])
sector2_lat_20=np.array([])
sector2_lon_20=np.array([])
sector2_loc_20=np.array([])
sector3_lat_20=np.array([])
sector3_lon_20=np.array([])
sector3_loc_20=np.array([])
sector4_lat_20=np.array([])
sector4_lon_20=np.array([])
sector4_loc_20=np.array([])
sector5_lat_20=np.array([])
sector5_lon_20=np.array([])
sector5_loc_20=np.array([])
sector6_lat_20=np.array([])
sector6_lon_20=np.array([])
sector6_loc_20=np.array([])
sector7_lat_20=np.array([])
sector7_lon_20=np.array([])
sector7_loc_20=np.array([])

sector1_lat_21=np.array([])
sector1_lon_21=np.array([])
sector1_loc_21=np.array([])
sector2_lat_21=np.array([])
sector2_lon_21=np.array([])
sector2_loc_21=np.array([])
sector3_lat_21=np.array([])
sector3_lon_21=np.array([])
sector3_loc_21=np.array([])
sector4_lat_21=np.array([])
sector4_lon_21=np.array([])
sector4_loc_21=np.array([])
sector5_lat_21=np.array([])
sector5_lon_21=np.array([])
sector5_loc_21=np.array([])
sector6_lat_21=np.array([])
sector6_lon_21=np.array([])
sector6_loc_21=np.array([])
sector7_lat_21=np.array([])
sector7_lon_21=np.array([])
sector7_loc_21=np.array([])

sector1_lat_22=np.array([])
sector1_lon_22=np.array([])
sector1_loc_22=np.array([])
sector2_lat_22=np.array([])
sector2_lon_22=np.array([])
sector2_loc_22=np.array([])
sector3_lat_22=np.array([])
sector3_lon_22=np.array([])
sector3_loc_22=np.array([])
sector4_lat_22=np.array([])
sector4_lon_22=np.array([])
sector4_loc_22=np.array([])
sector5_lat_22=np.array([])
sector5_lon_22=np.array([])
sector5_loc_22=np.array([])
sector6_lat_22=np.array([])
sector6_lon_22=np.array([])
sector6_loc_22=np.array([])
sector7_lat_22=np.array([])
sector7_lon_22=np.array([])
sector7_loc_22=np.array([])

sector1_lat_23=np.array([])
sector1_lon_23=np.array([])
sector1_loc_23=np.array([])
sector2_lat_23=np.array([])
sector2_lon_23=np.array([])
sector2_loc_23=np.array([])
sector3_lat_23=np.array([])
sector3_lon_23=np.array([])
sector3_loc_23=np.array([])
sector4_lat_23=np.array([])
sector4_lon_23=np.array([])
sector4_loc_23=np.array([])
sector5_lat_23=np.array([])
sector5_lon_23=np.array([])
sector5_loc_23=np.array([])
sector6_lat_23=np.array([])
sector6_lon_23=np.array([])
sector6_loc_23=np.array([])
sector7_lat_23=np.array([])
sector7_lon_23=np.array([])
sector7_loc_23=np.array([])

sector1_lat_24=np.array([])
sector1_lon_24=np.array([])
sector1_loc_24=np.array([])
sector2_lat_24=np.array([])
sector2_lon_24=np.array([])
sector2_loc_24=np.array([])
sector3_lat_24=np.array([])
sector3_lon_24=np.array([])
sector3_loc_24=np.array([])
sector4_lat_24=np.array([])
sector4_lon_24=np.array([])
sector4_loc_24=np.array([])
sector5_lat_24=np.array([])
sector5_lon_24=np.array([])
sector5_loc_24=np.array([])
sector6_lat_24=np.array([])
sector6_lon_24=np.array([])
sector6_loc_24=np.array([])
sector7_lat_24=np.array([])
sector7_lon_24=np.array([])
sector7_loc_24=np.array([])

sector1_lat_25=np.array([])
sector1_lon_25=np.array([])
sector1_loc_25=np.array([])
sector2_lat_25=np.array([])
sector2_lon_25=np.array([])
sector2_loc_25=np.array([])
sector3_lat_25=np.array([])
sector3_lon_25=np.array([])
sector3_loc_25=np.array([])
sector4_lat_25=np.array([])
sector4_lon_25=np.array([])
sector4_loc_25=np.array([])
sector5_lat_25=np.array([])
sector5_lon_25=np.array([])
sector5_loc_25=np.array([])
sector6_lat_25=np.array([])
sector6_lon_25=np.array([])
sector6_loc_25=np.array([])
sector7_lat_25=np.array([])
sector7_lon_25=np.array([])
sector7_loc_25=np.array([])

sector1_lat_26=np.array([])
sector1_lon_26=np.array([])
sector1_loc_26=np.array([])
sector2_lat_26=np.array([])
sector2_lon_26=np.array([])
sector2_loc_26=np.array([])
sector3_lat_26=np.array([])
sector3_lon_26=np.array([])
sector3_loc_26=np.array([])
sector4_lat_26=np.array([])
sector4_lon_26=np.array([])
sector4_loc_26=np.array([])
sector5_lat_26=np.array([])
sector5_lon_26=np.array([])
sector5_loc_26=np.array([])
sector6_lat_26=np.array([])
sector6_lon_26=np.array([])
sector6_loc_26=np.array([])
sector7_lat_26=np.array([])
sector7_lon_26=np.array([])
sector7_loc_26=np.array([])

sector1_lat_27=np.array([])
sector1_lon_27=np.array([])
sector1_loc_27=np.array([])
sector2_lat_27=np.array([])
sector2_lon_27=np.array([])
sector2_loc_27=np.array([])
sector3_lat_27=np.array([])
sector3_lon_27=np.array([])
sector3_loc_27=np.array([])
sector4_lat_27=np.array([])
sector4_lon_27=np.array([])
sector4_loc_27=np.array([])
sector5_lat_27=np.array([])
sector5_lon_27=np.array([])
sector5_loc_27=np.array([])
sector6_lat_27=np.array([])
sector6_lon_27=np.array([])
sector6_loc_27=np.array([])
sector7_lat_27=np.array([])
sector7_lon_27=np.array([])
sector7_loc_27=np.array([])


sector1_dis_0_=np.array([])
sector1_dis_1_=np.array([])
sector1_dis_2_=np.array([])
sector1_dis_3_=np.array([])
sector1_dis_4_=np.array([])
sector1_dis_5_=np.array([])
sector1_dis_6_=np.array([])
sector1_dis_7_=np.array([])
sector1_dis_8_=np.array([])
sector1_dis_9_=np.array([])
sector1_dis_10=np.array([])
sector1_dis_11=np.array([])
sector1_dis_12=np.array([])
sector1_dis_13=np.array([])
sector1_dis_14=np.array([])
sector1_dis_15=np.array([])
sector1_dis_16=np.array([])
sector1_dis_17=np.array([])
sector1_dis_18=np.array([])
sector1_dis_19=np.array([])
sector1_dis_20=np.array([])
sector1_dis_21=np.array([])
sector1_dis_22=np.array([])
sector1_dis_23=np.array([])
sector1_dis_24=np.array([])
sector1_dis_25=np.array([])
sector1_dis_26=np.array([])
sector1_dis_27=np.array([])

sector2_dis_0_=np.array([])
sector2_dis_1_=np.array([])
sector2_dis_2_=np.array([])
sector2_dis_3_=np.array([])
sector2_dis_4_=np.array([])
sector2_dis_5_=np.array([])
sector2_dis_6_=np.array([])
sector2_dis_7_=np.array([])
sector2_dis_8_=np.array([])
sector2_dis_9_=np.array([])
sector2_dis_10=np.array([])
sector2_dis_11=np.array([])
sector2_dis_12=np.array([])
sector2_dis_13=np.array([])
sector2_dis_14=np.array([])
sector2_dis_15=np.array([])
sector2_dis_16=np.array([])
sector2_dis_17=np.array([])
sector2_dis_18=np.array([])
sector2_dis_19=np.array([])
sector2_dis_20=np.array([])
sector2_dis_21=np.array([])
sector2_dis_22=np.array([])
sector2_dis_23=np.array([])
sector2_dis_24=np.array([])
sector2_dis_25=np.array([])
sector2_dis_26=np.array([])
sector2_dis_27=np.array([])

sector3_dis_0_=np.array([])
sector3_dis_1_=np.array([])
sector3_dis_2_=np.array([])
sector3_dis_3_=np.array([])
sector3_dis_4_=np.array([])
sector3_dis_5_=np.array([])
sector3_dis_6_=np.array([])
sector3_dis_7_=np.array([])
sector3_dis_8_=np.array([])
sector3_dis_9_=np.array([])
sector3_dis_10=np.array([])
sector3_dis_11=np.array([])
sector3_dis_12=np.array([])
sector3_dis_13=np.array([])
sector3_dis_14=np.array([])
sector3_dis_15=np.array([])
sector3_dis_16=np.array([])
sector3_dis_17=np.array([])
sector3_dis_18=np.array([])
sector3_dis_19=np.array([])
sector3_dis_20=np.array([])
sector3_dis_21=np.array([])
sector3_dis_22=np.array([])
sector3_dis_23=np.array([])
sector3_dis_24=np.array([])
sector3_dis_25=np.array([])
sector3_dis_26=np.array([])
sector3_dis_27=np.array([])

sector4_dis_0_=np.array([])
sector4_dis_1_=np.array([])
sector4_dis_2_=np.array([])
sector4_dis_3_=np.array([])
sector4_dis_4_=np.array([])
sector4_dis_5_=np.array([])
sector4_dis_6_=np.array([])
sector4_dis_7_=np.array([])
sector4_dis_8_=np.array([])
sector4_dis_9_=np.array([])
sector4_dis_10=np.array([])
sector4_dis_11=np.array([])
sector4_dis_12=np.array([])
sector4_dis_13=np.array([])
sector4_dis_14=np.array([])
sector4_dis_15=np.array([])
sector4_dis_16=np.array([])
sector4_dis_17=np.array([])
sector4_dis_18=np.array([])
sector4_dis_19=np.array([])
sector4_dis_20=np.array([])
sector4_dis_21=np.array([])
sector4_dis_22=np.array([])
sector4_dis_23=np.array([])
sector4_dis_24=np.array([])
sector4_dis_25=np.array([])
sector4_dis_26=np.array([])
sector4_dis_27=np.array([])

sector5_dis_0_=np.array([])
sector5_dis_1_=np.array([])
sector5_dis_2_=np.array([])
sector5_dis_3_=np.array([])
sector5_dis_4_=np.array([])
sector5_dis_5_=np.array([])
sector5_dis_6_=np.array([])
sector5_dis_7_=np.array([])
sector5_dis_8_=np.array([])
sector5_dis_9_=np.array([])
sector5_dis_10=np.array([])
sector5_dis_11=np.array([])
sector5_dis_12=np.array([])
sector5_dis_13=np.array([])
sector5_dis_14=np.array([])
sector5_dis_15=np.array([])
sector5_dis_16=np.array([])
sector5_dis_17=np.array([])
sector5_dis_18=np.array([])
sector5_dis_19=np.array([])
sector5_dis_20=np.array([])
sector5_dis_21=np.array([])
sector5_dis_22=np.array([])
sector5_dis_23=np.array([])
sector5_dis_24=np.array([])
sector5_dis_25=np.array([])
sector5_dis_26=np.array([])
sector5_dis_27=np.array([])






# In[5]

#  code that attempts to find the point of infinity in each dataset

cml=100

ofl_lat=np.array([])
ofl_lon=np.array([])

s_ssl=str(int(cml/10+1)*10)

# print(s_ssl)


v = open(os.path.join(sys.path[0],'fieldline_tracing/fieldline_tracing_mapping_contours_kk2009ext_jrm09int_north_sslong'+s_ssl+'.txt'))
north_plotting = np.zeros([28,36,4])

header = v.readline()

null1a='0'
null1b='0'
null2a='0'
null2b='0'

n1=np.array([0.])
n1b=np.array([.0])
n2=np.array([0.])
n2b=np.array([.0])




        
        
# In[4]



full_north_plotting=np.zeros([36,28,36,4])
for subsolarlongitude in range(0,359,10):
    ssl_step=int(subsolarlongitude/10)
    s_ssl=str((ssl_step+1)*10)
    print(ssl_step)
    # print(s_ssl)
    
    
    v = open(os.path.join(sys.path[0],'fieldline_tracing/fieldline_tracing_mapping_contours_kk2009ext_jrm09int_north_sslong'+s_ssl+'.txt'))
    north_plotting = np.zeros([28,36,4])
    
    header = v.readline()
    
    for z in range(28):
        for y in range(36):
            line = v.readline()
            full_north_plotting[ssl_step,z,y,0]=line[0:12]
            full_north_plotting[ssl_step,z,y,1]=line[14:20]
            null1=line[21:29]
            if any(chr.isdigit() for chr in null1):
                full_north_plotting[ssl_step,z,y,2]=null1
            else:
                full_north_plotting[ssl_step,z,y,2]=np.nan
            null2=line[30:38]
            if any(chr.isdigit() for chr in null2):
                full_north_plotting[ssl_step,z,y,3]=null2
            else:
                full_north_plotting[ssl_step,z,y,3]=np.nan







for cml in range(50,329,10):
    # cml=jc
    # # print(cml)
    # cml=float(80)
    # cml=float(140)
    # # cml=float(180)
    # # cml=float(210)
    # # cml=float(270)
    # cml=float(100)
    js=80
    
    subsolarlat=0
    subsolarlongitude=cml#240.3#+180
    
    
    s_ssl=str(int(subsolarlongitude/10+1)*10)
    
    # print(s_ssl)
    
    
    v = open(os.path.join(sys.path[0],'fieldline_tracing/fieldline_tracing_mapping_contours_kk2009ext_jrm09int_north_sslong'+s_ssl+'.txt'))
    north_plotting = np.zeros([28,36,4])
    
    header = v.readline()
    
    for z in range(28):
        for y in range(36):
            line = v.readline()
            north_plotting[z,y,0]=line[0:12]
            north_plotting[z,y,1]=line[14:20]
            null1=line[21:29]
            if any(chr.isdigit() for chr in null1):
                north_plotting[z,y,2]=null1
            else:
                north_plotting[z,y,2]=np.nan
            null2=line[30:38]
            if any(chr.isdigit() for chr in null2):
                north_plotting[z,y,3]=null2
            else:
                north_plotting[z,y,3]=np.nan
                           

     
    np_lat=np.zeros([5,])
    # five sectors 
    for i in range(1,6):
        # print(i,(i*30-180+75) ,((i+1)*30-180+75) )
        # print(i,(cml+i*30-180+75) ,(cml+(i+1)*30-180+75) )
        lon_min=360-(((i+1)*30-180+75+cml) % 360)
        lon_max=360-((i*30-180+75+cml) % 360)
        
        
        np_lat=north_plotting[0,:,3]
        
        np_0__lon2=north_plotting[0,:,3]
        np_0__lat2=north_plotting[0,:,2]
        np_0__loc2=north_plotting[0,:,1]
        np_0__dis2=north_plotting[0,:,0]

        np_1__lon2=north_plotting[1,:,3]
        np_1__lat2=north_plotting[1,:,2]
        np_1__loc2=north_plotting[1,:,1]
        np_1__dis2=north_plotting[1,:,0]

        np_2__lon2=north_plotting[2,:,3]
        np_2__lat2=north_plotting[2,:,2]
        np_2__loc2=north_plotting[2,:,1]
        np_2__dis2=north_plotting[2,:,0]

        np_3__lon2=north_plotting[3,:,3]
        np_3__lat2=north_plotting[3,:,2]
        np_3__loc2=north_plotting[3,:,1]
        np_3__dis2=north_plotting[3,:,0]

        np_4__lon2=north_plotting[4,:,3]
        np_4__lat2=north_plotting[4,:,2]
        np_4__loc2=north_plotting[4,:,1]
        np_4__dis2=north_plotting[4,:,0]

        np_5__lon2=north_plotting[5,:,3]
        np_5__lat2=north_plotting[5,:,2]
        np_5__loc2=north_plotting[5,:,1]
        np_5__dis2=north_plotting[5,:,0]

        np_6__lon2=north_plotting[6,:,3]
        np_6__lat2=north_plotting[6,:,2]
        np_6__loc2=north_plotting[6,:,1]
        np_6__dis2=north_plotting[6,:,0]

        np_7__lon2=north_plotting[7,:,3]
        np_7__lat2=north_plotting[7,:,2]
        np_7__loc2=north_plotting[7,:,1]
        np_7__dis2=north_plotting[7,:,0]

        np_8__lon2=north_plotting[8,:,3]
        np_8__lat2=north_plotting[8,:,2]
        np_8__loc2=north_plotting[8,:,1]
        np_8__dis2=north_plotting[8,:,0]

        np_9__lon2=north_plotting[9,:,3]
        np_9__lat2=north_plotting[9,:,2]
        np_9__loc2=north_plotting[9,:,1]
        np_9__dis2=north_plotting[9,:,0]

        np_10_lon2=north_plotting[10,:,3]
        np_10_lat2=north_plotting[10,:,2]
        np_10_loc2=north_plotting[10,:,1]
        np_10_dis2=north_plotting[10,:,0]

        np_11_lon2=north_plotting[11,:,3]
        np_11_lat2=north_plotting[11,:,2]
        np_11_loc2=north_plotting[11,:,1]
        np_11_dis2=north_plotting[11,:,0]

        np_12_lon2=north_plotting[12,:,3]
        np_12_lat2=north_plotting[12,:,2]
        np_12_loc2=north_plotting[12,:,1]
        np_12_dis2=north_plotting[12,:,0]

        np_13_lon2=north_plotting[13,:,3]
        np_13_lat2=north_plotting[13,:,2]
        np_13_loc2=north_plotting[13,:,1]
        np_13_dis2=north_plotting[13,:,0]

        np_14_lon2=north_plotting[14,:,3]
        np_14_lat2=north_plotting[14,:,2]
        np_14_loc2=north_plotting[14,:,1]
        np_14_dis2=north_plotting[14,:,0]

        np_15_lon2=north_plotting[15,:,3]
        np_15_lat2=north_plotting[15,:,2]
        np_15_loc2=north_plotting[15,:,1]
        np_15_dis2=north_plotting[15,:,0]

        np_16_lon2=north_plotting[16,:,3]
        np_16_lat2=north_plotting[16,:,2]
        np_16_loc2=north_plotting[16,:,1]
        np_16_dis2=north_plotting[16,:,0]

        np_17_lon2=north_plotting[17,:,3]
        np_17_lat2=north_plotting[17,:,2]
        np_17_loc2=north_plotting[17,:,1]
        np_17_dis2=north_plotting[17,:,0]

        np_18_lon2=north_plotting[18,:,3]
        np_18_lat2=north_plotting[18,:,2]
        np_18_loc2=north_plotting[18,:,1]
        np_18_dis2=north_plotting[18,:,0]

        np_19_lon2=north_plotting[19,:,3]
        np_19_lat2=north_plotting[19,:,2]
        np_19_loc2=north_plotting[19,:,1]
        np_19_dis2=north_plotting[19,:,0]

        np_20_lon2=north_plotting[20,:,3]
        np_20_lat2=north_plotting[20,:,2]
        np_20_loc2=north_plotting[20,:,1]
        np_20_dis2=north_plotting[20,:,0]

        np_21_lon2=north_plotting[21,:,3]
        np_21_lat2=north_plotting[21,:,2]
        np_21_loc2=north_plotting[21,:,1]
        np_21_dis2=north_plotting[21,:,0]

        np_22_lon2=north_plotting[22,:,3]
        np_22_lat2=north_plotting[22,:,2]
        np_22_loc2=north_plotting[22,:,1]
        np_22_dis2=north_plotting[22,:,0]

        np_23_lon2=north_plotting[23,:,3]
        np_23_lat2=north_plotting[23,:,2]
        np_23_loc2=north_plotting[23,:,1]
        np_23_dis2=north_plotting[23,:,0]

        np_24_lon2=north_plotting[24,:,3]
        np_24_lat2=north_plotting[24,:,2]
        np_24_loc2=north_plotting[24,:,1]
        np_24_dis2=north_plotting[24,:,0]

        np_25_lon2=north_plotting[25,:,3]
        np_25_lat2=north_plotting[25,:,2]
        np_25_loc2=north_plotting[25,:,1]
        np_25_dis2=north_plotting[25,:,0]

        np_26_lon2=north_plotting[26,:,3]
        np_26_lat2=north_plotting[26,:,2]
        np_26_loc2=north_plotting[26,:,1]
        np_26_dis2=north_plotting[26,:,0]

        np_27_lon2=north_plotting[27,:,3]
        np_27_lat2=north_plotting[27,:,2]
        np_27_loc2=north_plotting[27,:,1]
        np_27_dis2=north_plotting[27,:,0]

        # print(np_15_loc.shape)
    
        np_0__loc=np_0__loc2[(np_0__lon2 < lon_max) & (np_0__lon2 > lon_min) & (np.abs(np_0__lat2) < 86)]
        np_0__lat=np_0__lat2[(np_0__lon2 < lon_max) & (np_0__lon2 > lon_min) & (np.abs(np_0__lat2) < 86)]
        np_0__lon=np_0__lon2[(np_0__lon2 < lon_max) & (np_0__lon2 > lon_min) & (np.abs(np_0__lat2) < 86)]
         
        np_1__loc=np_1__loc2[(np_1__lon2 < lon_max) & (np_1__lon2 > lon_min) & (np.abs(np_1__lat2) < 86)]
        np_1__lat=np_1__lat2[(np_1__lon2 < lon_max) & (np_1__lon2 > lon_min) & (np.abs(np_1__lat2) < 86)]
        np_1__lon=np_1__lon2[(np_1__lon2 < lon_max) & (np_1__lon2 > lon_min) & (np.abs(np_1__lat2) < 86)]
            
        np_2__loc=np_2__loc2[(np_2__lon2 < lon_max) & (np_2__lon2 > lon_min) & (np.abs(np_2__lat2) < 86)]
        np_2__lat=np_2__lat2[(np_2__lon2 < lon_max) & (np_2__lon2 > lon_min) & (np.abs(np_2__lat2) < 86)]
        np_2__lon=np_2__lon2[(np_2__lon2 < lon_max) & (np_2__lon2 > lon_min) & (np.abs(np_2__lat2) < 86)]
            
        np_3__loc=np_3__loc2[(np_3__lon2 < lon_max) & (np_3__lon2 > lon_min) & (np.abs(np_3__lat2) < 86)]
        np_3__lat=np_3__lat2[(np_3__lon2 < lon_max) & (np_3__lon2 > lon_min) & (np.abs(np_3__lat2) < 86)]
        np_3__lon=np_3__lon2[(np_3__lon2 < lon_max) & (np_3__lon2 > lon_min) & (np.abs(np_3__lat2) < 86)]
            
        np_4__loc=np_4__loc2[(np_4__lon2 < lon_max) & (np_4__lon2 > lon_min) & (np.abs(np_4__lat2) < 86)]
        np_4__lat=np_4__lat2[(np_4__lon2 < lon_max) & (np_4__lon2 > lon_min) & (np.abs(np_4__lat2) < 86)]
        np_4__lon=np_4__lon2[(np_4__lon2 < lon_max) & (np_4__lon2 > lon_min) & (np.abs(np_4__lat2) < 86)]
            
        np_5__loc=np_5__loc2[(np_5__lon2 < lon_max) & (np_5__lon2 > lon_min) & (np.abs(np_5__lat2) < 86)]
        np_5__lat=np_5__lat2[(np_5__lon2 < lon_max) & (np_5__lon2 > lon_min) & (np.abs(np_5__lat2) < 86)]
        np_5__lon=np_5__lon2[(np_5__lon2 < lon_max) & (np_5__lon2 > lon_min) & (np.abs(np_5__lat2) < 86)]
            
        np_6__loc=np_6__loc2[(np_6__lon2 < lon_max) & (np_6__lon2 > lon_min) & (np.abs(np_6__lat2) < 86)]
        np_6__lat=np_6__lat2[(np_6__lon2 < lon_max) & (np_6__lon2 > lon_min) & (np.abs(np_6__lat2) < 86)]
        np_6__lon=np_6__lon2[(np_6__lon2 < lon_max) & (np_6__lon2 > lon_min) & (np.abs(np_6__lat2) < 86)]
            
        np_7__loc=np_7__loc2[(np_7__lon2 < lon_max) & (np_7__lon2 > lon_min) & (np.abs(np_7__lat2) < 86)]
        np_7__lat=np_7__lat2[(np_7__lon2 < lon_max) & (np_7__lon2 > lon_min) & (np.abs(np_7__lat2) < 86)]
        np_7__lon=np_7__lon2[(np_7__lon2 < lon_max) & (np_7__lon2 > lon_min) & (np.abs(np_7__lat2) < 86)]
            
        np_8__loc=np_8__loc2[(np_8__lon2 < lon_max) & (np_8__lon2 > lon_min) & (np.abs(np_8__lat2) < 86)]
        np_8__lat=np_8__lat2[(np_8__lon2 < lon_max) & (np_8__lon2 > lon_min) & (np.abs(np_8__lat2) < 86)]
        np_8__lon=np_8__lon2[(np_8__lon2 < lon_max) & (np_8__lon2 > lon_min) & (np.abs(np_8__lat2) < 86)]
            
        np_9__loc=np_9__loc2[(np_9__lon2 < lon_max) & (np_9__lon2 > lon_min) & (np.abs(np_9__lat2) < 86)]
        np_9__lat=np_9__lat2[(np_9__lon2 < lon_max) & (np_9__lon2 > lon_min) & (np.abs(np_9__lat2) < 86)]
        np_9__lon=np_9__lon2[(np_9__lon2 < lon_max) & (np_9__lon2 > lon_min) & (np.abs(np_9__lat2) < 86)]
 
        np_10_loc=np_10_loc2[(np_10_lon2 < lon_max) & (np_10_lon2 > lon_min) & (np.abs(np_10_lat2) < 86)]
        np_10_lat=np_10_lat2[(np_10_lon2 < lon_max) & (np_10_lon2 > lon_min) & (np.abs(np_10_lat2) < 86)]
        np_10_lon=np_10_lon2[(np_10_lon2 < lon_max) & (np_10_lon2 > lon_min) & (np.abs(np_10_lat2) < 86)]
 
        np_11_loc=np_11_loc2[(np_11_lon2 < lon_max) & (np_11_lon2 > lon_min) & (np.abs(np_11_lat2) < 86)]
        np_11_lat=np_11_lat2[(np_11_lon2 < lon_max) & (np_11_lon2 > lon_min) & (np.abs(np_11_lat2) < 86)]
        np_11_lon=np_11_lon2[(np_11_lon2 < lon_max) & (np_11_lon2 > lon_min) & (np.abs(np_11_lat2) < 86)]
 
        np_12_loc=np_12_loc2[(np_12_lon2 < lon_max) & (np_12_lon2 > lon_min) & (np.abs(np_12_lat2) < 86)]
        np_12_lat=np_12_lat2[(np_12_lon2 < lon_max) & (np_12_lon2 > lon_min) & (np.abs(np_12_lat2) < 86)]
        np_12_lon=np_12_lon2[(np_12_lon2 < lon_max) & (np_12_lon2 > lon_min) & (np.abs(np_12_lat2) < 86)]
 
        np_13_loc=np_13_loc2[(np_13_lon2 < lon_max) & (np_13_lon2 > lon_min) & (np.abs(np_13_lat2) < 86)]
        np_13_lat=np_13_lat2[(np_13_lon2 < lon_max) & (np_13_lon2 > lon_min) & (np.abs(np_13_lat2) < 86)]
        np_13_lon=np_13_lon2[(np_13_lon2 < lon_max) & (np_13_lon2 > lon_min) & (np.abs(np_13_lat2) < 86)]
 
        np_14_loc=np_14_loc2[(np_14_lon2 < lon_max) & (np_14_lon2 > lon_min) & (np.abs(np_14_lat2) < 86)]
        np_14_lat=np_14_lat2[(np_14_lon2 < lon_max) & (np_14_lon2 > lon_min) & (np.abs(np_14_lat2) < 86)]
        np_14_lon=np_14_lon2[(np_14_lon2 < lon_max) & (np_14_lon2 > lon_min) & (np.abs(np_14_lat2) < 86)]
 
        np_15_loc=np_15_loc2[(np_15_lon2 < lon_max) & (np_15_lon2 > lon_min) & (np.abs(np_15_lat2) < 86)]
        np_15_lat=np_15_lat2[(np_15_lon2 < lon_max) & (np_15_lon2 > lon_min) & (np.abs(np_15_lat2) < 86)]
        np_15_lon=np_15_lon2[(np_15_lon2 < lon_max) & (np_15_lon2 > lon_min) & (np.abs(np_15_lat2) < 86)]
 
        np_16_loc=np_16_loc2[(np_16_lon2 < lon_max) & (np_16_lon2 > lon_min) & (np.abs(np_16_lat2) < 86)]
        np_16_lat=np_16_lat2[(np_16_lon2 < lon_max) & (np_16_lon2 > lon_min) & (np.abs(np_16_lat2) < 86)]
        np_16_lon=np_16_lon2[(np_16_lon2 < lon_max) & (np_16_lon2 > lon_min) & (np.abs(np_16_lat2) < 86)]
 
        np_17_loc=np_17_loc2[(np_17_lon2 < lon_max) & (np_17_lon2 > lon_min) & (np.abs(np_17_lat2) < 86)]
        np_17_lat=np_17_lat2[(np_17_lon2 < lon_max) & (np_17_lon2 > lon_min) & (np.abs(np_17_lat2) < 86)]
        np_17_lon=np_17_lon2[(np_17_lon2 < lon_max) & (np_17_lon2 > lon_min) & (np.abs(np_17_lat2) < 86)]
 
        np_18_loc=np_18_loc2[(np_18_lon2 < lon_max) & (np_18_lon2 > lon_min) & (np.abs(np_18_lat2) < 86)]
        np_18_lat=np_18_lat2[(np_18_lon2 < lon_max) & (np_18_lon2 > lon_min) & (np.abs(np_18_lat2) < 86)]
        np_18_lon=np_18_lon2[(np_18_lon2 < lon_max) & (np_18_lon2 > lon_min) & (np.abs(np_18_lat2) < 86)]
 
        np_19_loc=np_19_loc2[(np_19_lon2 < lon_max) & (np_19_lon2 > lon_min) & (np.abs(np_19_lat2) < 86)]
        np_19_lat=np_19_lat2[(np_19_lon2 < lon_max) & (np_19_lon2 > lon_min) & (np.abs(np_19_lat2) < 86)]
        np_19_lon=np_19_lon2[(np_19_lon2 < lon_max) & (np_19_lon2 > lon_min) & (np.abs(np_19_lat2) < 86)]
 
        np_20_loc=np_20_loc2[(np_20_lon2 < lon_max) & (np_20_lon2 > lon_min) & (np.abs(np_20_lat2) < 86)]
        np_20_lat=np_20_lat2[(np_20_lon2 < lon_max) & (np_20_lon2 > lon_min) & (np.abs(np_20_lat2) < 86)]
        np_20_lon=np_20_lon2[(np_20_lon2 < lon_max) & (np_20_lon2 > lon_min) & (np.abs(np_20_lat2) < 86)]
 
        np_21_loc=np_21_loc2[(np_21_lon2 < lon_max) & (np_21_lon2 > lon_min) & (np.abs(np_21_lat2) < 86)]
        np_21_lat=np_21_lat2[(np_21_lon2 < lon_max) & (np_21_lon2 > lon_min) & (np.abs(np_21_lat2) < 86)]
        np_21_lon=np_21_lon2[(np_21_lon2 < lon_max) & (np_21_lon2 > lon_min) & (np.abs(np_21_lat2) < 86)]
 
        np_22_loc=np_22_loc2[(np_22_lon2 < lon_max) & (np_22_lon2 > lon_min) & (np.abs(np_22_lat2) < 86)]
        np_22_lat=np_22_lat2[(np_22_lon2 < lon_max) & (np_22_lon2 > lon_min) & (np.abs(np_22_lat2) < 86)]
        np_22_lon=np_22_lon2[(np_22_lon2 < lon_max) & (np_22_lon2 > lon_min) & (np.abs(np_22_lat2) < 86)]
 
        np_23_loc=np_23_loc2[(np_23_lon2 < lon_max) & (np_23_lon2 > lon_min) & (np.abs(np_23_lat2) < 86)]
        np_23_lat=np_23_lat2[(np_23_lon2 < lon_max) & (np_23_lon2 > lon_min) & (np.abs(np_23_lat2) < 86)]
        np_23_lon=np_23_lon2[(np_23_lon2 < lon_max) & (np_23_lon2 > lon_min) & (np.abs(np_23_lat2) < 86)]
 
        np_24_loc=np_24_loc2[(np_24_lon2 < lon_max) & (np_24_lon2 > lon_min) & (np.abs(np_24_lat2) < 86)]
        np_24_lat=np_24_lat2[(np_24_lon2 < lon_max) & (np_24_lon2 > lon_min) & (np.abs(np_24_lat2) < 86)]
        np_24_lon=np_24_lon2[(np_24_lon2 < lon_max) & (np_24_lon2 > lon_min) & (np.abs(np_24_lat2) < 86)]
 
        np_25_loc=np_25_loc2[(np_25_lon2 < lon_max) & (np_25_lon2 > lon_min) & (np.abs(np_25_lat2) < 86)]
        np_25_lat=np_25_lat2[(np_25_lon2 < lon_max) & (np_25_lon2 > lon_min) & (np.abs(np_25_lat2) < 86)]
        np_25_lon=np_25_lon2[(np_25_lon2 < lon_max) & (np_25_lon2 > lon_min) & (np.abs(np_25_lat2) < 86)]
 
        np_26_loc=np_26_loc2[(np_26_lon2 < lon_max) & (np_26_lon2 > lon_min) & (np.abs(np_26_lat2) < 86)]
        np_26_lat=np_26_lat2[(np_26_lon2 < lon_max) & (np_26_lon2 > lon_min) & (np.abs(np_26_lat2) < 86)]
        np_26_lon=np_26_lon2[(np_26_lon2 < lon_max) & (np_26_lon2 > lon_min) & (np.abs(np_26_lat2) < 86)]
 
        np_27_loc=np_27_loc2[(np_27_lon2 < lon_max) & (np_27_lon2 > lon_min) & (np.abs(np_27_lat2) < 86)]
        np_27_lat=np_27_lat2[(np_27_lon2 < lon_max) & (np_27_lon2 > lon_min) & (np.abs(np_27_lat2) < 86)]
        np_27_lon=np_27_lon2[(np_27_lon2 < lon_max) & (np_27_lon2 > lon_min) & (np.abs(np_27_lat2) < 86)]
    

        np_0__dis=np_0__dis2[(np_0__lon2 < lon_max) & (np_0__lon2 > lon_min) & (np.abs(np_0__lat2) < 86)]
        np_1__dis=np_1__dis2[(np_1__lon2 < lon_max) & (np_1__lon2 > lon_min) & (np.abs(np_1__lat2) < 86)]
        np_2__dis=np_2__dis2[(np_2__lon2 < lon_max) & (np_2__lon2 > lon_min) & (np.abs(np_2__lat2) < 86)]
        np_3__dis=np_3__dis2[(np_3__lon2 < lon_max) & (np_3__lon2 > lon_min) & (np.abs(np_3__lat2) < 86)]
        np_4__dis=np_4__dis2[(np_4__lon2 < lon_max) & (np_4__lon2 > lon_min) & (np.abs(np_4__lat2) < 86)]
        np_5__dis=np_5__dis2[(np_5__lon2 < lon_max) & (np_5__lon2 > lon_min) & (np.abs(np_5__lat2) < 86)]
        np_6__dis=np_6__dis2[(np_6__lon2 < lon_max) & (np_6__lon2 > lon_min) & (np.abs(np_6__lat2) < 86)]
        np_7__dis=np_7__dis2[(np_7__lon2 < lon_max) & (np_7__lon2 > lon_min) & (np.abs(np_7__lat2) < 86)]
        np_8__dis=np_8__dis2[(np_8__lon2 < lon_max) & (np_8__lon2 > lon_min) & (np.abs(np_8__lat2) < 86)]
        np_9__dis=np_9__dis2[(np_9__lon2 < lon_max) & (np_9__lon2 > lon_min) & (np.abs(np_9__lat2) < 86)]
        np_10_dis=np_10_dis2[(np_10_lon2 < lon_max) & (np_10_lon2 > lon_min) & (np.abs(np_10_lat2) < 86)]
        np_11_dis=np_11_dis2[(np_11_lon2 < lon_max) & (np_11_lon2 > lon_min) & (np.abs(np_11_lat2) < 86)]
        np_12_dis=np_12_dis2[(np_12_lon2 < lon_max) & (np_12_lon2 > lon_min) & (np.abs(np_12_lat2) < 86)]
        np_13_dis=np_13_dis2[(np_13_lon2 < lon_max) & (np_13_lon2 > lon_min) & (np.abs(np_13_lat2) < 86)]
        np_14_dis=np_14_dis2[(np_14_lon2 < lon_max) & (np_14_lon2 > lon_min) & (np.abs(np_14_lat2) < 86)]
        np_15_dis=np_15_dis2[(np_15_lon2 < lon_max) & (np_15_lon2 > lon_min) & (np.abs(np_15_lat2) < 86)]
        np_16_dis=np_16_dis2[(np_16_lon2 < lon_max) & (np_16_lon2 > lon_min) & (np.abs(np_16_lat2) < 86)]
        np_17_dis=np_17_dis2[(np_17_lon2 < lon_max) & (np_17_lon2 > lon_min) & (np.abs(np_17_lat2) < 86)]
        np_18_dis=np_18_dis2[(np_18_lon2 < lon_max) & (np_18_lon2 > lon_min) & (np.abs(np_18_lat2) < 86)]
        np_19_dis=np_19_dis2[(np_19_lon2 < lon_max) & (np_19_lon2 > lon_min) & (np.abs(np_19_lat2) < 86)]
        np_20_dis=np_20_dis2[(np_20_lon2 < lon_max) & (np_20_lon2 > lon_min) & (np.abs(np_20_lat2) < 86)]
        np_21_dis=np_21_dis2[(np_21_lon2 < lon_max) & (np_21_lon2 > lon_min) & (np.abs(np_21_lat2) < 86)]
        np_22_dis=np_22_dis2[(np_22_lon2 < lon_max) & (np_22_lon2 > lon_min) & (np.abs(np_22_lat2) < 86)]
        np_23_dis=np_23_dis2[(np_23_lon2 < lon_max) & (np_23_lon2 > lon_min) & (np.abs(np_23_lat2) < 86)]
        np_24_dis=np_24_dis2[(np_24_lon2 < lon_max) & (np_24_lon2 > lon_min) & (np.abs(np_24_lat2) < 86)]
        np_25_dis=np_25_dis2[(np_25_lon2 < lon_max) & (np_25_lon2 > lon_min) & (np.abs(np_25_lat2) < 86)]
        np_26_dis=np_26_dis2[(np_26_lon2 < lon_max) & (np_26_lon2 > lon_min) & (np.abs(np_26_lat2) < 86)]
        np_27_dis=np_27_dis2[(np_27_lon2 < lon_max) & (np_27_lon2 > lon_min) & (np.abs(np_27_lat2) < 86)]


        # print(np_15_loc.shape)
    
        if i == 1:
            
            if np_0__lat.size > 0:
                sector1_lat_0_=np.append(sector1_lat_0_,np_0__lat)
                sector1_lon_0_=np.append(sector1_lon_0_,np_0__lon)
                sector1_loc_0_=np.append(sector1_loc_0_,np_0__loc)
                sector1_dis_0_=np.append(sector1_dis_0_,np_0__dis)

            if np_1__lat.size > 0:       
                sector1_lat_1_=np.append(sector1_lat_1_,np_1__lat)
                sector1_lon_1_=np.append(sector1_lon_1_,np_1__lon)
                sector1_loc_1_=np.append(sector1_loc_1_,np_1__loc)
                sector1_dis_1_=np.append(sector1_dis_1_,np_1__dis)

            if np_2__lat.size > 0:         
                sector1_lat_2_=np.append(sector1_lat_2_,np_2__lat)
                sector1_lon_2_=np.append(sector1_lon_2_,np_2__lon)
                sector1_loc_2_=np.append(sector1_loc_2_,np_2__loc)
                sector1_dis_2_=np.append(sector1_dis_2_,np_2__dis)

            if np_3__lat.size > 0:         
                sector1_lat_3_=np.append(sector1_lat_3_,np_3__lat)
                sector1_lon_3_=np.append(sector1_lon_3_,np_3__lon)
                sector1_loc_3_=np.append(sector1_loc_3_,np_3__loc)
                sector1_dis_3_=np.append(sector1_dis_3_,np_3__dis)

            if np_4__lat.size > 0:         
                sector1_lat_4_=np.append(sector1_lat_4_,np_4__lat)
                sector1_lon_4_=np.append(sector1_lon_4_,np_4__lon)
                sector1_loc_4_=np.append(sector1_loc_4_,np_4__loc)
                sector1_dis_4_=np.append(sector1_dis_4_,np_4__dis)

            if np_5__lat.size > 0:         
                sector1_lat_5_=np.append(sector1_lat_5_,np_5__lat)
                sector1_lon_5_=np.append(sector1_lon_5_,np_5__lon)
                sector1_loc_5_=np.append(sector1_loc_5_,np_5__loc)
                sector1_dis_5_=np.append(sector1_dis_5_,np_5__dis)

            if np_6__lat.size > 0:         
                sector1_lat_6_=np.append(sector1_lat_6_,np_6__lat)
                sector1_lon_6_=np.append(sector1_lon_6_,np_6__lon)
                sector1_loc_6_=np.append(sector1_loc_6_,np_6__loc)
                sector1_dis_6_=np.append(sector1_dis_6_,np_6__dis)

            if np_7__lat.size > 0:         
                sector1_lat_7_=np.append(sector1_lat_7_,np_7__lat)
                sector1_lon_7_=np.append(sector1_lon_7_,np_7__lon)
                sector1_loc_7_=np.append(sector1_loc_7_,np_7__loc)
                sector1_dis_7_=np.append(sector1_dis_7_,np_7__dis)

            if np_8__lat.size > 0:         
                sector1_lat_8_=np.append(sector1_lat_8_,np_8__lat)
                sector1_lon_8_=np.append(sector1_lon_8_,np_8__lon)
                sector1_loc_8_=np.append(sector1_loc_8_,np_8__loc)
                sector1_dis_8_=np.append(sector1_dis_8_,np_8__dis)

            if np_9__lat.size > 0:         
                sector1_lat_9_=np.append(sector1_lat_9_,np_9__lat)
                sector1_lon_9_=np.append(sector1_lon_9_,np_9__lon)
                sector1_loc_9_=np.append(sector1_loc_9_,np_9__loc)
                sector1_dis_9_=np.append(sector1_dis_9_,np_9__dis)

            if np_10_lat.size > 0:
                sector1_lat_10=np.append(sector1_lat_10,np_10_lat)
                sector1_lon_10=np.append(sector1_lon_10,np_10_lon)
                sector1_loc_10=np.append(sector1_loc_10,np_10_loc)
                sector1_dis_10=np.append(sector1_dis_10,np_10_dis)

            if np_11_lat.size > 0:
                sector1_lat_11=np.append(sector1_lat_11,np_11_lat)
                sector1_lon_11=np.append(sector1_lon_11,np_11_lon)
                sector1_loc_11=np.append(sector1_loc_11,np_11_loc)
                sector1_dis_11=np.append(sector1_dis_11,np_11_dis)

            if np_12_lat.size > 0:
                sector1_lat_12=np.append(sector1_lat_12,np_12_lat)
                sector1_lon_12=np.append(sector1_lon_12,np_12_lon)
                sector1_loc_12=np.append(sector1_loc_12,np_12_loc)
                sector1_dis_12=np.append(sector1_dis_12,np_12_dis)

            if np_13_lat.size > 0:
                sector1_lat_13=np.append(sector1_lat_13,np_13_lat)
                sector1_lon_13=np.append(sector1_lon_13,np_13_lon)
                sector1_loc_13=np.append(sector1_loc_13,np_13_loc)
                sector1_dis_13=np.append(sector1_dis_13,np_13_dis)

            if np_14_lat.size > 0:
                sector1_lat_14=np.append(sector1_lat_14,np_14_lat)
                sector1_lon_14=np.append(sector1_lon_14,np_14_lon)
                sector1_loc_14=np.append(sector1_loc_14,np_14_loc)
                sector1_dis_14=np.append(sector1_dis_14,np_14_dis)

            if np_15_lat.size > 0:
                sector1_lat_15=np.append(sector1_lat_15,np_15_lat)
                sector1_lon_15=np.append(sector1_lon_15,np_15_lon)
                sector1_loc_15=np.append(sector1_loc_15,np_15_loc)
                sector1_dis_15=np.append(sector1_dis_15,np_15_dis)

            if np_16_lat.size > 0:
                sector1_lat_16=np.append(sector1_lat_16,np_16_lat)
                sector1_lon_16=np.append(sector1_lon_16,np_16_lon)
                sector1_loc_16=np.append(sector1_loc_16,np_16_loc)
                sector1_dis_16=np.append(sector1_dis_16,np_16_dis)
             
            if np_17_lat.size > 0:
                sector1_lat_17=np.append(sector1_lat_17,np_17_lat)
                sector1_lon_17=np.append(sector1_lon_17,np_17_lon)
                sector1_loc_17=np.append(sector1_loc_17,np_17_loc)
                sector1_dis_17=np.append(sector1_dis_17,np_17_dis)

            if np_18_lat.size > 0:
                sector1_lat_18=np.append(sector1_lat_18,np_18_lat)
                sector1_lon_18=np.append(sector1_lon_18,np_18_lon)
                sector1_loc_18=np.append(sector1_loc_18,np_18_loc)
                sector1_dis_18=np.append(sector1_dis_18,np_18_dis)

            if np_19_lat.size > 0:
                sector1_lat_19=np.append(sector1_lat_19,np_19_lat)
                sector1_lon_19=np.append(sector1_lon_19,np_19_lon)
                sector1_loc_19=np.append(sector1_loc_19,np_19_loc)
                sector1_dis_19=np.append(sector1_dis_19,np_19_dis)

            if np_20_lat.size > 0:
                sector1_lat_20=np.append(sector1_lat_20,np_20_lat)
                sector1_lon_20=np.append(sector1_lon_20,np_20_lon)
                sector1_loc_20=np.append(sector1_loc_20,np_20_loc)
                sector1_dis_20=np.append(sector1_dis_20,np_20_dis)

            if np_21_lat.size > 0:
                sector1_lat_21=np.append(sector1_lat_21,np_21_lat)
                sector1_lon_21=np.append(sector1_lon_21,np_21_lon)
                sector1_loc_21=np.append(sector1_loc_21,np_21_loc)
                sector1_dis_21=np.append(sector1_dis_21,np_21_dis)
	
            if np_22_lat.size > 0:
                sector1_lat_22=np.append(sector1_lat_22,np_22_lat)
                sector1_lon_22=np.append(sector1_lon_22,np_22_lon)
                sector1_loc_22=np.append(sector1_loc_22,np_22_loc)
                sector1_dis_22=np.append(sector1_dis_22,np_22_dis)
	
            if np_23_lat.size > 0:
                sector1_lat_23=np.append(sector1_lat_23,np_23_lat)
                sector1_lon_23=np.append(sector1_lon_23,np_23_lon)
                sector1_loc_23=np.append(sector1_loc_23,np_23_loc)
                sector1_dis_23=np.append(sector1_dis_23,np_23_dis)
	
            if np_24_lat.size > 0:
                sector1_lat_24=np.append(sector1_lat_24,np_24_lat)
                sector1_lon_24=np.append(sector1_lon_24,np_24_lon)
                sector1_loc_24=np.append(sector1_loc_24,np_24_loc)
                sector1_dis_24=np.append(sector1_dis_24,np_24_dis)
	
            if np_25_lat.size > 0:
                sector1_lat_25=np.append(sector1_lat_25,np_25_lat)
                sector1_lon_25=np.append(sector1_lon_25,np_25_lon)
                sector1_loc_25=np.append(sector1_loc_25,np_25_loc)
                sector1_dis_25=np.append(sector1_dis_25,np_25_dis)
	
            if np_26_lat.size > 0:
                sector1_lat_26=np.append(sector1_lat_26,np_26_lat)
                sector1_lon_26=np.append(sector1_lon_26,np_26_lon)
                sector1_loc_26=np.append(sector1_loc_26,np_26_loc)
                sector1_dis_26=np.append(sector1_dis_26,np_26_dis)
	
            if np_27_lat.size > 0:
                sector1_lat_27=np.append(sector1_lat_27,np_27_lat)
                sector1_lon_27=np.append(sector1_lon_27,np_27_lon)
                sector1_loc_27=np.append(sector1_loc_27,np_27_loc)
                sector1_dis_27=np.append(sector1_dis_27,np_27_dis)

	
	
        if i == 2:
            if np_0__lat.size > 0:
                sector2_lat_0_=np.append(sector2_lat_0_,np_0__lat)
                sector2_lon_0_=np.append(sector2_lon_0_,np_0__lon)
                sector2_loc_0_=np.append(sector2_loc_0_,np_0__loc)
                sector2_dis_0_=np.append(sector2_dis_0_,np_0__dis)

            if np_1__lat.size > 0:       
                sector2_lat_1_=np.append(sector2_lat_1_,np_1__lat)
                sector2_lon_1_=np.append(sector2_lon_1_,np_1__lon)
                sector2_loc_1_=np.append(sector2_loc_1_,np_1__loc)
                sector2_dis_1_=np.append(sector2_dis_1_,np_1__dis)

            if np_2__lat.size > 0:         
                sector2_lat_2_=np.append(sector2_lat_2_,np_2__lat)
                sector2_lon_2_=np.append(sector2_lon_2_,np_2__lon)
                sector2_loc_2_=np.append(sector2_loc_2_,np_2__loc)
                sector2_dis_2_=np.append(sector2_dis_2_,np_2__dis)

            if np_3__lat.size > 0:         
                sector2_lat_3_=np.append(sector2_lat_3_,np_3__lat)
                sector2_lon_3_=np.append(sector2_lon_3_,np_3__lon)
                sector2_loc_3_=np.append(sector2_loc_3_,np_3__loc)
                sector2_dis_3_=np.append(sector2_dis_3_,np_3__dis)

            if np_4__lat.size > 0:         
                sector2_lat_4_=np.append(sector2_lat_4_,np_4__lat)
                sector2_lon_4_=np.append(sector2_lon_4_,np_4__lon)
                sector2_loc_4_=np.append(sector2_loc_4_,np_4__loc)
                sector2_dis_4_=np.append(sector2_dis_4_,np_4__dis)

            if np_5__lat.size > 0:         
                sector2_lat_5_=np.append(sector2_lat_5_,np_5__lat)
                sector2_lon_5_=np.append(sector2_lon_5_,np_5__lon)
                sector2_loc_5_=np.append(sector2_loc_5_,np_5__loc)
                sector2_dis_5_=np.append(sector2_dis_5_,np_5__dis)

            if np_6__lat.size > 0:         
                sector2_lat_6_=np.append(sector2_lat_6_,np_6__lat)
                sector2_lon_6_=np.append(sector2_lon_6_,np_6__lon)
                sector2_loc_6_=np.append(sector2_loc_6_,np_6__loc)
                sector2_dis_6_=np.append(sector2_dis_6_,np_6__dis)

            if np_7__lat.size > 0:         
                sector2_lat_7_=np.append(sector2_lat_7_,np_7__lat)
                sector2_lon_7_=np.append(sector2_lon_7_,np_7__lon)
                sector2_loc_7_=np.append(sector2_loc_7_,np_7__loc)
                sector2_dis_7_=np.append(sector2_dis_7_,np_7__dis)

            if np_8__lat.size > 0:         
                sector2_lat_8_=np.append(sector2_lat_8_,np_8__lat)
                sector2_lon_8_=np.append(sector2_lon_8_,np_8__lon)
                sector2_loc_8_=np.append(sector2_loc_8_,np_8__loc)
                sector2_dis_8_=np.append(sector2_dis_8_,np_8__dis)

            if np_9__lat.size > 0:         
                sector2_lat_9_=np.append(sector2_lat_9_,np_9__lat)
                sector2_lon_9_=np.append(sector2_lon_9_,np_9__lon)
                sector2_loc_9_=np.append(sector2_loc_9_,np_9__loc)
                sector2_dis_9_=np.append(sector2_dis_9_,np_9__dis)

            if np_10_lat.size > 0:
                sector2_lat_10=np.append(sector2_lat_10,np_10_lat)
                sector2_lon_10=np.append(sector2_lon_10,np_10_lon)
                sector2_loc_10=np.append(sector2_loc_10,np_10_loc)
                sector2_dis_10=np.append(sector2_dis_10,np_10_dis)

            if np_11_lat.size > 0:
                sector2_lat_11=np.append(sector2_lat_11,np_11_lat)
                sector2_lon_11=np.append(sector2_lon_11,np_11_lon)
                sector2_loc_11=np.append(sector2_loc_11,np_11_loc)
                sector2_dis_11=np.append(sector2_dis_11,np_11_dis)

            if np_12_lat.size > 0:
                sector2_lat_12=np.append(sector2_lat_12,np_12_lat)
                sector2_lon_12=np.append(sector2_lon_12,np_12_lon)
                sector2_loc_12=np.append(sector2_loc_12,np_12_loc)
                sector2_dis_12=np.append(sector2_dis_12,np_12_dis)

            if np_13_lat.size > 0:
                sector2_lat_13=np.append(sector2_lat_13,np_13_lat)
                sector2_lon_13=np.append(sector2_lon_13,np_13_lon)
                sector2_loc_13=np.append(sector2_loc_13,np_13_loc)
                sector2_dis_13=np.append(sector2_dis_13,np_13_dis)

            if np_14_lat.size > 0:
                sector2_lat_14=np.append(sector2_lat_14,np_14_lat)
                sector2_lon_14=np.append(sector2_lon_14,np_14_lon)
                sector2_loc_14=np.append(sector2_loc_14,np_14_loc)
                sector2_dis_14=np.append(sector2_dis_14,np_14_dis)

            if np_15_lat.size > 0:
                sector2_lat_15=np.append(sector2_lat_15,np_15_lat)
                sector2_lon_15=np.append(sector2_lon_15,np_15_lon)
                sector2_loc_15=np.append(sector2_loc_15,np_15_loc)
                sector2_dis_15=np.append(sector2_dis_15,np_15_dis)

            if np_16_lat.size > 0:
                sector2_lat_16=np.append(sector2_lat_16,np_16_lat)
                sector2_lon_16=np.append(sector2_lon_16,np_16_lon)
                sector2_loc_16=np.append(sector2_loc_16,np_16_loc)
                sector2_dis_16=np.append(sector2_dis_16,np_16_dis)
             
            if np_17_lat.size > 0:
                sector2_lat_17=np.append(sector2_lat_17,np_17_lat)
                sector2_lon_17=np.append(sector2_lon_17,np_17_lon)
                sector2_loc_17=np.append(sector2_loc_17,np_17_loc)
                sector2_dis_17=np.append(sector2_dis_17,np_17_dis)

            if np_18_lat.size > 0:
                sector2_lat_18=np.append(sector2_lat_18,np_18_lat)
                sector2_lon_18=np.append(sector2_lon_18,np_18_lon)
                sector2_loc_18=np.append(sector2_loc_18,np_18_loc)
                sector2_dis_18=np.append(sector2_dis_18,np_18_dis)

            if np_19_lat.size > 0:
                sector2_lat_19=np.append(sector2_lat_19,np_19_lat)
                sector2_lon_19=np.append(sector2_lon_19,np_19_lon)
                sector2_loc_19=np.append(sector2_loc_19,np_19_loc)
                sector2_dis_19=np.append(sector2_dis_19,np_19_dis)

            if np_20_lat.size > 0:
                sector2_lat_20=np.append(sector2_lat_20,np_20_lat)
                sector2_lon_20=np.append(sector2_lon_20,np_20_lon)
                sector2_loc_20=np.append(sector2_loc_20,np_20_loc)
                sector2_dis_20=np.append(sector2_dis_20,np_20_dis)

            if np_21_lat.size > 0:
                sector2_lat_21=np.append(sector2_lat_21,np_21_lat)
                sector2_lon_21=np.append(sector2_lon_21,np_21_lon)
                sector2_loc_21=np.append(sector2_loc_21,np_21_loc)
                sector2_dis_21=np.append(sector2_dis_21,np_21_dis)
	
            if np_22_lat.size > 0:
                sector2_lat_22=np.append(sector2_lat_22,np_22_lat)
                sector2_lon_22=np.append(sector2_lon_22,np_22_lon)
                sector2_loc_22=np.append(sector2_loc_22,np_22_loc)
                sector2_dis_22=np.append(sector2_dis_22,np_22_dis)
	
            if np_23_lat.size > 0:
                sector2_lat_23=np.append(sector2_lat_23,np_23_lat)
                sector2_lon_23=np.append(sector2_lon_23,np_23_lon)
                sector2_loc_23=np.append(sector2_loc_23,np_23_loc)
                sector2_dis_23=np.append(sector2_dis_23,np_23_dis)
	
            if np_24_lat.size > 0:
                sector2_lat_24=np.append(sector2_lat_24,np_24_lat)
                sector2_lon_24=np.append(sector2_lon_24,np_24_lon)
                sector2_loc_24=np.append(sector2_loc_24,np_24_loc)
                sector2_dis_24=np.append(sector2_dis_24,np_24_dis)
	
            if np_25_lat.size > 0:
                sector2_lat_25=np.append(sector2_lat_25,np_25_lat)
                sector2_lon_25=np.append(sector2_lon_25,np_25_lon)
                sector2_loc_25=np.append(sector2_loc_25,np_25_loc)
                sector2_dis_25=np.append(sector2_dis_25,np_25_dis)
	
            if np_26_lat.size > 0:
                sector2_lat_26=np.append(sector2_lat_26,np_26_lat)
                sector2_lon_26=np.append(sector2_lon_26,np_26_lon)
                sector2_loc_26=np.append(sector2_loc_26,np_26_loc)
                sector2_dis_26=np.append(sector2_dis_26,np_26_dis)
	
            if np_27_lat.size > 0:
                sector2_lat_27=np.append(sector2_lat_27,np_27_lat)
                sector2_lon_27=np.append(sector2_lon_27,np_27_lon)
                sector2_loc_27=np.append(sector2_loc_27,np_27_loc)
                sector2_dis_27=np.append(sector2_dis_27,np_27_dis)
	
	
        if i == 3:
            if np_0__lat.size > 0:
                sector3_lat_0_=np.append(sector3_lat_0_,np_0__lat)
                sector3_lon_0_=np.append(sector3_lon_0_,np_0__lon)
                sector3_loc_0_=np.append(sector3_loc_0_,np_0__loc)
                sector3_dis_0_=np.append(sector3_dis_0_,np_0__dis)

            if np_1__lat.size > 0:       
                sector3_lat_1_=np.append(sector3_lat_1_,np_1__lat)
                sector3_lon_1_=np.append(sector3_lon_1_,np_1__lon)
                sector3_loc_1_=np.append(sector3_loc_1_,np_1__loc)
                sector3_dis_1_=np.append(sector3_dis_1_,np_1__dis)

            if np_2__lat.size > 0:         
                sector3_lat_2_=np.append(sector3_lat_2_,np_2__lat)
                sector3_lon_2_=np.append(sector3_lon_2_,np_2__lon)
                sector3_loc_2_=np.append(sector3_loc_2_,np_2__loc)
                sector3_dis_2_=np.append(sector3_dis_2_,np_2__dis)

            if np_3__lat.size > 0:         
                sector3_lat_3_=np.append(sector3_lat_3_,np_3__lat)
                sector3_lon_3_=np.append(sector3_lon_3_,np_3__lon)
                sector3_loc_3_=np.append(sector3_loc_3_,np_3__loc)
                sector3_dis_3_=np.append(sector3_dis_3_,np_3__dis)

            if np_4__lat.size > 0:         
                sector3_lat_4_=np.append(sector3_lat_4_,np_4__lat)
                sector3_lon_4_=np.append(sector3_lon_4_,np_4__lon)
                sector3_loc_4_=np.append(sector3_loc_4_,np_4__loc)
                sector3_dis_4_=np.append(sector3_dis_4_,np_4__dis)

            if np_5__lat.size > 0:         
                sector3_lat_5_=np.append(sector3_lat_5_,np_5__lat)
                sector3_lon_5_=np.append(sector3_lon_5_,np_5__lon)
                sector3_loc_5_=np.append(sector3_loc_5_,np_5__loc)
                sector3_dis_5_=np.append(sector3_dis_5_,np_5__dis)

            if np_6__lat.size > 0:         
                sector3_lat_6_=np.append(sector3_lat_6_,np_6__lat)
                sector3_lon_6_=np.append(sector3_lon_6_,np_6__lon)
                sector3_loc_6_=np.append(sector3_loc_6_,np_6__loc)
                sector3_dis_6_=np.append(sector3_dis_6_,np_6__dis)

            if np_7__lat.size > 0:         
                sector3_lat_7_=np.append(sector3_lat_7_,np_7__lat)
                sector3_lon_7_=np.append(sector3_lon_7_,np_7__lon)
                sector3_loc_7_=np.append(sector3_loc_7_,np_7__loc)
                sector3_dis_7_=np.append(sector3_dis_7_,np_7__dis)

            if np_8__lat.size > 0:         
                sector3_lat_8_=np.append(sector3_lat_8_,np_8__lat)
                sector3_lon_8_=np.append(sector3_lon_8_,np_8__lon)
                sector3_loc_8_=np.append(sector3_loc_8_,np_8__loc)
                sector3_dis_8_=np.append(sector3_dis_8_,np_8__dis)

            if np_9__lat.size > 0:         
                sector3_lat_9_=np.append(sector3_lat_9_,np_9__lat)
                sector3_lon_9_=np.append(sector3_lon_9_,np_9__lon)
                sector3_loc_9_=np.append(sector3_loc_9_,np_9__loc)
                sector3_dis_9_=np.append(sector3_dis_9_,np_9__dis)

            if np_10_lat.size > 0:
                sector3_lat_10=np.append(sector3_lat_10,np_10_lat)
                sector3_lon_10=np.append(sector3_lon_10,np_10_lon)
                sector3_loc_10=np.append(sector3_loc_10,np_10_loc)
                sector3_dis_10=np.append(sector3_dis_10,np_10_dis)

            if np_11_lat.size > 0:
                sector3_lat_11=np.append(sector3_lat_11,np_11_lat)
                sector3_lon_11=np.append(sector3_lon_11,np_11_lon)
                sector3_loc_11=np.append(sector3_loc_11,np_11_loc)
                sector3_dis_11=np.append(sector3_dis_11,np_11_dis)

            if np_12_lat.size > 0:
                sector3_lat_12=np.append(sector3_lat_12,np_12_lat)
                sector3_lon_12=np.append(sector3_lon_12,np_12_lon)
                sector3_loc_12=np.append(sector3_loc_12,np_12_loc)
                sector3_dis_12=np.append(sector3_dis_12,np_12_dis)

            if np_13_lat.size > 0:
                sector3_lat_13=np.append(sector3_lat_13,np_13_lat)
                sector3_lon_13=np.append(sector3_lon_13,np_13_lon)
                sector3_loc_13=np.append(sector3_loc_13,np_13_loc)
                sector3_dis_13=np.append(sector3_dis_13,np_13_dis)

            if np_14_lat.size > 0:
                sector3_lat_14=np.append(sector3_lat_14,np_14_lat)
                sector3_lon_14=np.append(sector3_lon_14,np_14_lon)
                sector3_loc_14=np.append(sector3_loc_14,np_14_loc)
                sector3_dis_14=np.append(sector3_dis_14,np_14_dis)

            if np_15_lat.size > 0:
                sector3_lat_15=np.append(sector3_lat_15,np_15_lat)
                sector3_lon_15=np.append(sector3_lon_15,np_15_lon)
                sector3_loc_15=np.append(sector3_loc_15,np_15_loc)
                sector3_dis_15=np.append(sector3_dis_15,np_15_dis)

            if np_16_lat.size > 0:
                sector3_lat_16=np.append(sector3_lat_16,np_16_lat)
                sector3_lon_16=np.append(sector3_lon_16,np_16_lon)
                sector3_loc_16=np.append(sector3_loc_16,np_16_loc)
                sector3_dis_16=np.append(sector3_dis_16,np_16_dis)
             
            if np_17_lat.size > 0:
                sector3_lat_17=np.append(sector3_lat_17,np_17_lat)
                sector3_lon_17=np.append(sector3_lon_17,np_17_lon)
                sector3_loc_17=np.append(sector3_loc_17,np_17_loc)
                sector3_dis_17=np.append(sector3_dis_17,np_17_dis)

            if np_18_lat.size > 0:
                sector3_lat_18=np.append(sector3_lat_18,np_18_lat)
                sector3_lon_18=np.append(sector3_lon_18,np_18_lon)
                sector3_loc_18=np.append(sector3_loc_18,np_18_loc)
                sector3_dis_18=np.append(sector3_dis_18,np_18_dis)

            if np_19_lat.size > 0:
                sector3_lat_19=np.append(sector3_lat_19,np_19_lat)
                sector3_lon_19=np.append(sector3_lon_19,np_19_lon)
                sector3_loc_19=np.append(sector3_loc_19,np_19_loc)
                sector3_dis_19=np.append(sector3_dis_19,np_19_dis)

            if np_20_lat.size > 0:
                sector3_lat_20=np.append(sector3_lat_20,np_20_lat)
                sector3_lon_20=np.append(sector3_lon_20,np_20_lon)
                sector3_loc_20=np.append(sector3_loc_20,np_20_loc)
                sector3_dis_20=np.append(sector3_dis_20,np_20_dis)

            if np_21_lat.size > 0:
                sector3_lat_21=np.append(sector3_lat_21,np_21_lat)
                sector3_lon_21=np.append(sector3_lon_21,np_21_lon)
                sector3_loc_21=np.append(sector3_loc_21,np_21_loc)
                sector3_dis_21=np.append(sector3_dis_21,np_21_dis)
	
            if np_22_lat.size > 0:
                sector3_lat_22=np.append(sector3_lat_22,np_22_lat)
                sector3_lon_22=np.append(sector3_lon_22,np_22_lon)
                sector3_loc_22=np.append(sector3_loc_22,np_22_loc)
                sector3_dis_22=np.append(sector3_dis_22,np_22_dis)
	
            if np_23_lat.size > 0:
                sector3_lat_23=np.append(sector3_lat_23,np_23_lat)
                sector3_lon_23=np.append(sector3_lon_23,np_23_lon)
                sector3_loc_23=np.append(sector3_loc_23,np_23_loc)
                sector3_dis_23=np.append(sector3_dis_23,np_23_dis)
	
            if np_24_lat.size > 0:
                sector3_lat_24=np.append(sector3_lat_24,np_24_lat)
                sector3_lon_24=np.append(sector3_lon_24,np_24_lon)
                sector3_loc_24=np.append(sector3_loc_24,np_24_loc)
                sector3_dis_24=np.append(sector3_dis_24,np_24_dis)
	
            if np_25_lat.size > 0:
                sector3_lat_25=np.append(sector3_lat_25,np_25_lat)
                sector3_lon_25=np.append(sector3_lon_25,np_25_lon)
                sector3_loc_25=np.append(sector3_loc_25,np_25_loc)
                sector3_dis_25=np.append(sector3_dis_25,np_25_dis)
	
            if np_26_lat.size > 0:
                sector3_lat_26=np.append(sector3_lat_26,np_26_lat)
                sector3_lon_26=np.append(sector3_lon_26,np_26_lon)
                sector3_loc_26=np.append(sector3_loc_26,np_26_loc)
                sector3_dis_26=np.append(sector3_dis_26,np_26_dis)
	
            if np_27_lat.size > 0:
                sector3_lat_27=np.append(sector3_lat_27,np_27_lat)
                sector3_lon_27=np.append(sector3_lon_27,np_27_lon)
                sector3_loc_27=np.append(sector3_loc_27,np_27_loc)
                sector3_dis_27=np.append(sector3_dis_27,np_27_dis)
	
	
        if i == 4:
            if np_0__lat.size > 0:
                sector4_lat_0_=np.append(sector4_lat_0_,np_0__lat)
                sector4_lon_0_=np.append(sector4_lon_0_,np_0__lon)
                sector4_loc_0_=np.append(sector4_loc_0_,np_0__loc)
                sector4_dis_0_=np.append(sector4_dis_0_,np_0__dis)

            if np_1__lat.size > 0:       
                sector4_lat_1_=np.append(sector4_lat_1_,np_1__lat)
                sector4_lon_1_=np.append(sector4_lon_1_,np_1__lon)
                sector4_loc_1_=np.append(sector4_loc_1_,np_1__loc)
                sector4_dis_1_=np.append(sector4_dis_1_,np_1__dis)

            if np_2__lat.size > 0:         
                sector4_lat_2_=np.append(sector4_lat_2_,np_2__lat)
                sector4_lon_2_=np.append(sector4_lon_2_,np_2__lon)
                sector4_loc_2_=np.append(sector4_loc_2_,np_2__loc)
                sector4_dis_2_=np.append(sector4_dis_2_,np_2__dis)

            if np_3__lat.size > 0:         
                sector4_lat_3_=np.append(sector4_lat_3_,np_3__lat)
                sector4_lon_3_=np.append(sector4_lon_3_,np_3__lon)
                sector4_loc_3_=np.append(sector4_loc_3_,np_3__loc)
                sector4_dis_3_=np.append(sector4_dis_3_,np_3__dis)

            if np_4__lat.size > 0:         
                sector4_lat_4_=np.append(sector4_lat_4_,np_4__lat)
                sector4_lon_4_=np.append(sector4_lon_4_,np_4__lon)
                sector4_loc_4_=np.append(sector4_loc_4_,np_4__loc)
                sector4_dis_4_=np.append(sector4_dis_4_,np_4__dis)

            if np_5__lat.size > 0:         
                sector4_lat_5_=np.append(sector4_lat_5_,np_5__lat)
                sector4_lon_5_=np.append(sector4_lon_5_,np_5__lon)
                sector4_loc_5_=np.append(sector4_loc_5_,np_5__loc)
                sector4_dis_5_=np.append(sector4_dis_5_,np_5__dis)

            if np_6__lat.size > 0:         
                sector4_lat_6_=np.append(sector4_lat_6_,np_6__lat)
                sector4_lon_6_=np.append(sector4_lon_6_,np_6__lon)
                sector4_loc_6_=np.append(sector4_loc_6_,np_6__loc)
                sector4_dis_6_=np.append(sector4_dis_6_,np_6__dis)

            if np_7__lat.size > 0:         
                sector4_lat_7_=np.append(sector4_lat_7_,np_7__lat)
                sector4_lon_7_=np.append(sector4_lon_7_,np_7__lon)
                sector4_loc_7_=np.append(sector4_loc_7_,np_7__loc)
                sector4_dis_7_=np.append(sector4_dis_7_,np_7__dis)

            if np_8__lat.size > 0:         
                sector4_lat_8_=np.append(sector4_lat_8_,np_8__lat)
                sector4_lon_8_=np.append(sector4_lon_8_,np_8__lon)
                sector4_loc_8_=np.append(sector4_loc_8_,np_8__loc)
                sector4_dis_8_=np.append(sector4_dis_8_,np_8__dis)

            if np_9__lat.size > 0:         
                sector4_lat_9_=np.append(sector4_lat_9_,np_9__lat)
                sector4_lon_9_=np.append(sector4_lon_9_,np_9__lon)
                sector4_loc_9_=np.append(sector4_loc_9_,np_9__loc)
                sector4_dis_9_=np.append(sector4_dis_9_,np_9__dis)

            if np_10_lat.size > 0:
                sector4_lat_10=np.append(sector4_lat_10,np_10_lat)
                sector4_lon_10=np.append(sector4_lon_10,np_10_lon)
                sector4_loc_10=np.append(sector4_loc_10,np_10_loc)
                sector4_dis_10=np.append(sector4_dis_10,np_10_dis)

            if np_11_lat.size > 0:
                sector4_lat_11=np.append(sector4_lat_11,np_11_lat)
                sector4_lon_11=np.append(sector4_lon_11,np_11_lon)
                sector4_loc_11=np.append(sector4_loc_11,np_11_loc)
                sector4_dis_11=np.append(sector4_dis_11,np_11_dis)

            if np_12_lat.size > 0:
                sector4_lat_12=np.append(sector4_lat_12,np_12_lat)
                sector4_lon_12=np.append(sector4_lon_12,np_12_lon)
                sector4_loc_12=np.append(sector4_loc_12,np_12_loc)
                sector4_dis_12=np.append(sector4_dis_12,np_12_dis)

            if np_13_lat.size > 0:
                sector4_lat_13=np.append(sector4_lat_13,np_13_lat)
                sector4_lon_13=np.append(sector4_lon_13,np_13_lon)
                sector4_loc_13=np.append(sector4_loc_13,np_13_loc)
                sector4_dis_13=np.append(sector4_dis_13,np_13_dis)

            if np_14_lat.size > 0:
                sector4_lat_14=np.append(sector4_lat_14,np_14_lat)
                sector4_lon_14=np.append(sector4_lon_14,np_14_lon)
                sector4_loc_14=np.append(sector4_loc_14,np_14_loc)
                sector4_dis_14=np.append(sector4_dis_14,np_14_dis)

            if np_15_lat.size > 0:
                sector4_lat_15=np.append(sector4_lat_15,np_15_lat)
                sector4_lon_15=np.append(sector4_lon_15,np_15_lon)
                sector4_loc_15=np.append(sector4_loc_15,np_15_loc)
                sector4_dis_15=np.append(sector4_dis_15,np_15_dis)

            if np_16_lat.size > 0:
                sector4_lat_16=np.append(sector4_lat_16,np_16_lat)
                sector4_lon_16=np.append(sector4_lon_16,np_16_lon)
                sector4_loc_16=np.append(sector4_loc_16,np_16_loc)
                sector4_dis_16=np.append(sector4_dis_16,np_16_dis)
             
            if np_17_lat.size > 0:
                sector4_lat_17=np.append(sector4_lat_17,np_17_lat)
                sector4_lon_17=np.append(sector4_lon_17,np_17_lon)
                sector4_loc_17=np.append(sector4_loc_17,np_17_loc)
                sector4_dis_17=np.append(sector4_dis_17,np_17_dis)

            if np_18_lat.size > 0:
                sector4_lat_18=np.append(sector4_lat_18,np_18_lat)
                sector4_lon_18=np.append(sector4_lon_18,np_18_lon)
                sector4_loc_18=np.append(sector4_loc_18,np_18_loc)
                sector4_dis_18=np.append(sector4_dis_18,np_18_dis)

            if np_19_lat.size > 0:
                sector4_lat_19=np.append(sector4_lat_19,np_19_lat)
                sector4_lon_19=np.append(sector4_lon_19,np_19_lon)
                sector4_loc_19=np.append(sector4_loc_19,np_19_loc)
                sector4_dis_19=np.append(sector4_dis_19,np_19_dis)

            if np_20_lat.size > 0:
                sector4_lat_20=np.append(sector4_lat_20,np_20_lat)
                sector4_lon_20=np.append(sector4_lon_20,np_20_lon)
                sector4_loc_20=np.append(sector4_loc_20,np_20_loc)
                sector4_dis_20=np.append(sector4_dis_20,np_20_dis)

            if np_21_lat.size > 0:
                sector4_lat_21=np.append(sector4_lat_21,np_21_lat)
                sector4_lon_21=np.append(sector4_lon_21,np_21_lon)
                sector4_loc_21=np.append(sector4_loc_21,np_21_loc)
                sector4_dis_21=np.append(sector4_dis_21,np_21_dis)
	
            if np_22_lat.size > 0:
                sector4_lat_22=np.append(sector4_lat_22,np_22_lat)
                sector4_lon_22=np.append(sector4_lon_22,np_22_lon)
                sector4_loc_22=np.append(sector4_loc_22,np_22_loc)
                sector4_dis_22=np.append(sector4_dis_22,np_22_dis)
	
            if np_23_lat.size > 0:
                sector4_lat_23=np.append(sector4_lat_23,np_23_lat)
                sector4_lon_23=np.append(sector4_lon_23,np_23_lon)
                sector4_loc_23=np.append(sector4_loc_23,np_23_loc)
                sector4_dis_23=np.append(sector4_dis_23,np_23_dis)
	
            if np_24_lat.size > 0:
                sector4_lat_24=np.append(sector4_lat_24,np_24_lat)
                sector4_lon_24=np.append(sector4_lon_24,np_24_lon)
                sector4_loc_24=np.append(sector4_loc_24,np_24_loc)
                sector4_dis_24=np.append(sector4_dis_24,np_24_dis)
	
            if np_25_lat.size > 0:
                sector4_lat_25=np.append(sector4_lat_25,np_25_lat)
                sector4_lon_25=np.append(sector4_lon_25,np_25_lon)
                sector4_loc_25=np.append(sector4_loc_25,np_25_loc)
                sector4_dis_25=np.append(sector4_dis_25,np_25_dis)
	
            if np_26_lat.size > 0:
                sector4_lat_26=np.append(sector4_lat_26,np_26_lat)
                sector4_lon_26=np.append(sector4_lon_26,np_26_lon)
                sector4_loc_26=np.append(sector4_loc_26,np_26_loc)
                sector4_dis_26=np.append(sector4_dis_26,np_26_dis)
	
            if np_27_lat.size > 0:
                sector4_lat_27=np.append(sector4_lat_27,np_27_lat)
                sector4_lon_27=np.append(sector4_lon_27,np_27_lon)
                sector4_loc_27=np.append(sector4_loc_27,np_27_loc)
                sector4_dis_27=np.append(sector4_dis_27,np_27_dis)
	
	
        if i == 5:
            if np_0__lat.size > 0:
                sector5_lat_0_=np.append(sector5_lat_0_,np_0__lat)
                sector5_lon_0_=np.append(sector5_lon_0_,np_0__lon)
                sector5_loc_0_=np.append(sector5_loc_0_,np_0__loc)
                sector5_dis_0_=np.append(sector5_dis_0_,np_0__dis)

            if np_1__lat.size > 0:       
                sector5_lat_1_=np.append(sector5_lat_1_,np_1__lat)
                sector5_lon_1_=np.append(sector5_lon_1_,np_1__lon)
                sector5_loc_1_=np.append(sector5_loc_1_,np_1__loc)
                sector5_dis_1_=np.append(sector5_dis_1_,np_1__dis)

            if np_2__lat.size > 0:         
                sector5_lat_2_=np.append(sector5_lat_2_,np_2__lat)
                sector5_lon_2_=np.append(sector5_lon_2_,np_2__lon)
                sector5_loc_2_=np.append(sector5_loc_2_,np_2__loc)
                sector5_dis_2_=np.append(sector5_dis_2_,np_2__dis)

            if np_3__lat.size > 0:         
                sector5_lat_3_=np.append(sector5_lat_3_,np_3__lat)
                sector5_lon_3_=np.append(sector5_lon_3_,np_3__lon)
                sector5_loc_3_=np.append(sector5_loc_3_,np_3__loc)
                sector5_dis_3_=np.append(sector5_dis_3_,np_3__dis)

            if np_4__lat.size > 0:         
                sector5_lat_4_=np.append(sector5_lat_4_,np_4__lat)
                sector5_lon_4_=np.append(sector5_lon_4_,np_4__lon)
                sector5_loc_4_=np.append(sector5_loc_4_,np_4__loc)
                sector5_dis_4_=np.append(sector5_dis_4_,np_4__dis)

            if np_5__lat.size > 0:         
                sector5_lat_5_=np.append(sector5_lat_5_,np_5__lat)
                sector5_lon_5_=np.append(sector5_lon_5_,np_5__lon)
                sector5_loc_5_=np.append(sector5_loc_5_,np_5__loc)
                sector5_dis_5_=np.append(sector5_dis_5_,np_5__dis)

            if np_6__lat.size > 0:         
                sector5_lat_6_=np.append(sector5_lat_6_,np_6__lat)
                sector5_lon_6_=np.append(sector5_lon_6_,np_6__lon)
                sector5_loc_6_=np.append(sector5_loc_6_,np_6__loc)
                sector5_dis_6_=np.append(sector5_dis_6_,np_6__dis)

            if np_7__lat.size > 0:         
                sector5_lat_7_=np.append(sector5_lat_7_,np_7__lat)
                sector5_lon_7_=np.append(sector5_lon_7_,np_7__lon)
                sector5_loc_7_=np.append(sector5_loc_7_,np_7__loc)
                sector5_dis_7_=np.append(sector5_dis_7_,np_7__dis)

            if np_8__lat.size > 0:         
                sector5_lat_8_=np.append(sector5_lat_8_,np_8__lat)
                sector5_lon_8_=np.append(sector5_lon_8_,np_8__lon)
                sector5_loc_8_=np.append(sector5_loc_8_,np_8__loc)
                sector5_dis_8_=np.append(sector5_dis_8_,np_8__dis)

            if np_9__lat.size > 0:         
                sector5_lat_9_=np.append(sector5_lat_9_,np_9__lat)
                sector5_lon_9_=np.append(sector5_lon_9_,np_9__lon)
                sector5_loc_9_=np.append(sector5_loc_9_,np_9__loc)
                sector5_dis_9_=np.append(sector5_dis_9_,np_9__dis)

            if np_10_lat.size > 0:
                sector5_lat_10=np.append(sector5_lat_10,np_10_lat)
                sector5_lon_10=np.append(sector5_lon_10,np_10_lon)
                sector5_loc_10=np.append(sector5_loc_10,np_10_loc)
                sector5_dis_10=np.append(sector5_dis_10,np_10_dis)

            if np_11_lat.size > 0:
                sector5_lat_11=np.append(sector5_lat_11,np_11_lat)
                sector5_lon_11=np.append(sector5_lon_11,np_11_lon)
                sector5_loc_11=np.append(sector5_loc_11,np_11_loc)
                sector5_dis_11=np.append(sector5_dis_11,np_11_dis)

            if np_12_lat.size > 0:
                sector5_lat_12=np.append(sector5_lat_12,np_12_lat)
                sector5_lon_12=np.append(sector5_lon_12,np_12_lon)
                sector5_loc_12=np.append(sector5_loc_12,np_12_loc)
                sector5_dis_12=np.append(sector5_dis_12,np_12_dis)

            if np_13_lat.size > 0:
                sector5_lat_13=np.append(sector5_lat_13,np_13_lat)
                sector5_lon_13=np.append(sector5_lon_13,np_13_lon)
                sector5_loc_13=np.append(sector5_loc_13,np_13_loc)
                sector5_dis_13=np.append(sector5_dis_13,np_13_dis)

            if np_14_lat.size > 0:
                sector5_lat_14=np.append(sector5_lat_14,np_14_lat)
                sector5_lon_14=np.append(sector5_lon_14,np_14_lon)
                sector5_loc_14=np.append(sector5_loc_14,np_14_loc)
                sector5_dis_14=np.append(sector5_dis_14,np_14_dis)

            if np_15_lat.size > 0:
                sector5_lat_15=np.append(sector5_lat_15,np_15_lat)
                sector5_lon_15=np.append(sector5_lon_15,np_15_lon)
                sector5_loc_15=np.append(sector5_loc_15,np_15_loc)
                sector5_dis_15=np.append(sector5_dis_15,np_15_dis)

            if np_16_lat.size > 0:
                sector5_lat_16=np.append(sector5_lat_16,np_16_lat)
                sector5_lon_16=np.append(sector5_lon_16,np_16_lon)
                sector5_loc_16=np.append(sector5_loc_16,np_16_loc)
                sector5_dis_16=np.append(sector5_dis_16,np_16_dis)
             
            if np_17_lat.size > 0:
                sector5_lat_17=np.append(sector5_lat_17,np_17_lat)
                sector5_lon_17=np.append(sector5_lon_17,np_17_lon)
                sector5_loc_17=np.append(sector5_loc_17,np_17_loc)
                sector5_dis_17=np.append(sector5_dis_17,np_17_dis)

            if np_18_lat.size > 0:
                sector5_lat_18=np.append(sector5_lat_18,np_18_lat)
                sector5_lon_18=np.append(sector5_lon_18,np_18_lon)
                sector5_loc_18=np.append(sector5_loc_18,np_18_loc)
                sector5_dis_18=np.append(sector5_dis_18,np_18_dis)

            if np_19_lat.size > 0:
                sector5_lat_19=np.append(sector5_lat_19,np_19_lat)
                sector5_lon_19=np.append(sector5_lon_19,np_19_lon)
                sector5_loc_19=np.append(sector5_loc_19,np_19_loc)
                sector5_dis_19=np.append(sector5_dis_19,np_19_dis)

            if np_20_lat.size > 0:
                sector5_lat_20=np.append(sector5_lat_20,np_20_lat)
                sector5_lon_20=np.append(sector5_lon_20,np_20_lon)
                sector5_loc_20=np.append(sector5_loc_20,np_20_loc)
                sector5_dis_20=np.append(sector5_dis_20,np_20_dis)

            if np_21_lat.size > 0:
                sector5_lat_21=np.append(sector5_lat_21,np_21_lat)
                sector5_lon_21=np.append(sector5_lon_21,np_21_lon)
                sector5_loc_21=np.append(sector5_loc_21,np_21_loc)
                sector5_dis_21=np.append(sector5_dis_21,np_21_dis)
	
            if np_22_lat.size > 0:
                sector5_lat_22=np.append(sector5_lat_22,np_22_lat)
                sector5_lon_22=np.append(sector5_lon_22,np_22_lon)
                sector5_loc_22=np.append(sector5_loc_22,np_22_loc)
                sector5_dis_22=np.append(sector5_dis_22,np_22_dis)
	
            if np_23_lat.size > 0:
                sector5_lat_23=np.append(sector5_lat_23,np_23_lat)
                sector5_lon_23=np.append(sector5_lon_23,np_23_lon)
                sector5_loc_23=np.append(sector5_loc_23,np_23_loc)
                sector5_dis_23=np.append(sector5_dis_23,np_23_dis)
	
            if np_24_lat.size > 0:
                sector5_lat_24=np.append(sector5_lat_24,np_24_lat)
                sector5_lon_24=np.append(sector5_lon_24,np_24_lon)
                sector5_loc_24=np.append(sector5_loc_24,np_24_loc)
                sector5_dis_24=np.append(sector5_dis_24,np_24_dis)
	
            if np_25_lat.size > 0:
                sector5_lat_25=np.append(sector5_lat_25,np_25_lat)
                sector5_lon_25=np.append(sector5_lon_25,np_25_lon)
                sector5_loc_25=np.append(sector5_loc_25,np_25_loc)
                sector5_dis_25=np.append(sector5_dis_25,np_25_dis)
	
            if np_26_lat.size > 0:
                sector5_lat_26=np.append(sector5_lat_26,np_26_lat)
                sector5_lon_26=np.append(sector5_lon_26,np_26_lon)
                sector5_loc_26=np.append(sector5_loc_26,np_26_loc)
                sector5_dis_26=np.append(sector5_dis_26,np_26_dis)
	
            if np_27_lat.size > 0:
                sector5_lat_27=np.append(sector5_lat_27,np_27_lat)
                sector5_lon_27=np.append(sector5_lon_27,np_27_lon)
                sector5_loc_27=np.append(sector5_loc_27,np_27_loc)
                sector5_dis_27=np.append(sector5_dis_27,np_27_dis)
	
	
	
	
	
	
	
	
	
	
# In[4]	
	
	
	
	
	
	
             

# seven sectors
    # for i in range(1,8):
    #     # print(i,(i*30-180+75) ,((i+1)*30-180+75) )
    #     # print(i,(cml+i*30-180+75) ,(cml+(i+1)*30-180+75) )
    #     lon_min=360-(((i+1)*20-180+90+cml) % 360)
    #     lon_max=360-((i*20-180+90+cml) % 360)


    #     np_15_lon2=north_plotting[0,:,3]
    #     np_15_lat2=north_plotting[0,:,2]
    #     np_15_loc2=north_plotting[0,:,1]
    
    
    #     np_150_lon2=north_plotting[27,:,3]
    #     np_150_lat2=north_plotting[27,:,2]
    #     np_150_loc2=north_plotting[27,:,1]
    
    
    #     # print(np_15_loc.shape)
    
    #     np_15_loc=np_15_loc2[(np_15_lon2 < lon_max) & (np_15_lon2 > lon_min) & (np.abs(np_15_lat2) < 86)]
    #     np_15_lat=np_15_lat2[(np_15_lon2 < lon_max) & (np_15_lon2 > lon_min) & (np.abs(np_15_lat2) < 86)]
    #     np_15_lon=np_15_lon2[(np_15_lon2 < lon_max) & (np_15_lon2 > lon_min) & (np.abs(np_15_lat2) < 86)]
 
    #     np_150_loc=np_150_loc2[(np_150_lon2 < lon_max) & (np_150_lon2 > lon_min) & (np.abs(np_150_lat2) < 86)]
    #     np_150_lat=np_150_lat2[(np_150_lon2 < lon_max) & (np_150_lon2 > lon_min) & (np.abs(np_150_lat2) < 86)]
    #     np_150_lon=np_150_lon2[(np_150_lon2 < lon_max) & (np_150_lon2 > lon_min) & (np.abs(np_150_lat2) < 86)]

    
    #     # print(np_15_loc.shape)
    
    #     if i == 1:
    #         if np_15_lat.size > 0:
    #             sector1_lat=np.append(sector1_lat,np_15_lat)
    #             sector1_lon=np.append(sector1_lon,np_15_lon)
    #             sector1_loc=np.append(sector1_loc,np_15_loc)
    #         if np_150_lat.size > 0:
    #             sector1_lat150=np.append(sector1_lat150,np_150_lat)
    #             sector1_lon150=np.append(sector1_lon150,np_150_lon)
    #             sector1_loc150=np.append(sector1_loc150,np_150_loc)
    #     if i == 2:
    #         if np_15_lat.size > 0:
    #             sector2_lat=np.append(sector2_lat,np_15_lat)
    #             sector2_lon=np.append(sector2_lon,np_15_lon)
    #             sector2_loc=np.append(sector2_loc,np_15_loc)
    #         if np_150_lat.size > 0:
    #              sector2_lat150=np.append(sector2_lat150,np_150_lat)
    #              sector2_lon150=np.append(sector2_lon150,np_150_lon)
    #              sector2_loc150=np.append(sector2_loc150,np_150_loc)
    #     if i == 3:
    #          if np_15_lat.size > 0:
    #              sector3_lat=np.append(sector3_lat,np_15_lat)
    #              sector3_lon=np.append(sector3_lon,np_15_lon)
    #              sector3_loc=np.append(sector3_loc,np_15_loc)
    #          if np_150_lat.size > 0:
    #             sector3_lat150=np.append(sector3_lat150,np_150_lat)
    #             sector3_lon150=np.append(sector3_lon150,np_150_lon)
    #             sector3_loc150=np.append(sector3_loc150,np_150_loc)
    #     if i == 4:
    #          if np_15_lat.size > 0:
    #              sector4_lat=np.append(sector4_lat,np_15_lat)
    #              sector4_lon=np.append(sector4_lon,np_15_lon)
    #              sector4_loc=np.append(sector4_loc,np_15_loc)
    #          if np_150_lat.size > 0:
    #              sector4_lat150=np.append(sector4_lat150,np_150_lat)
    #              sector4_lon150=np.append(sector4_lon150,np_150_lon)
    #              sector4_loc150=np.append(sector4_loc150,np_150_loc)
    #     if i == 5:
    #           if np_15_lat.size > 0:
    #               sector5_lat=np.append(sector5_lat,np_15_lat)
    #               sector5_lon=np.append(sector5_lon,np_15_lon)
    #               sector5_loc=np.append(sector5_loc,np_15_loc)
    #           if np_150_lat.size > 0:
    #               sector5_lat150=np.append(sector5_lat150,np_150_lat)
    #               sector5_lon150=np.append(sector5_lon150,np_150_lon)
    #               sector5_loc150=np.append(sector5_loc150,np_150_loc)
    #     if i == 6:
    #            if np_15_lat.size > 0:
    #                sector6_lat=np.append(sector6_lat,np_15_lat)
    #                sector6_lon=np.append(sector6_lon,np_15_lon)
    #                sector6_loc=np.append(sector6_loc,np_15_loc)
    #            if np_150_lat.size > 0:
    #              sector6_lat150=np.append(sector6_lat150,np_150_lat)
    #              sector6_lon150=np.append(sector6_lon150,np_150_lon)
    #              sector6_loc150=np.append(sector6_loc150,np_150_loc)
    #     if i == 7:
    #           if np_15_lat.size > 0:
    #               sector7_lat=np.append(sector7_lat,np_15_lat)
    #               sector7_lon=np.append(sector7_lon,np_15_lon)
    #               sector7_loc=np.append(sector7_loc,np_15_loc)
    #           if np_150_lat.size > 0:
    #              sector7_lat150=np.append(sector7_lat150,np_150_lat)
    #              sector7_lon150=np.append(sector7_lon150,np_150_lon)
    #              sector7_loc150=np.append(sector7_loc150,np_150_loc)
             



    # In[5]

if runhere:

    cml=180
    
    for subsolarlongitude in range(120,250,30):
        ssl_step=int(subsolarlongitude/10)
        crs = ccrs.RotatedPole(globe=ccrs.Globe(flattening=(0.0)))
        ax = plt.axes(projection=ccrs.Orthographic(360-cml,              js))
        
        ax.set_global()
        ax.add_feature(jup_night(subsolarlat,360-subsolarlongitude,              alpha=0.2))
        
        gl = ax.gridlines(crs=ccrs.PlateCarree(),              linewidth=1,              color='black',              alpha=0.5,              linestyle='dotted',              draw_labels=True)
        gl.xlocator = mticker.FixedLocator(np.arange(18)*20-180)
        gl.ylocator = mticker.FixedLocator(np.arange(9)*20-90)
    



        ssl_step=ssl_step-1
        for jj in range(27): 
            plt.scatter(full_north_plotting[ssl_step,jj,:,3],full_north_plotting[ssl_step,jj,:,2],transform=ccrs.PlateCarree(),c=full_north_plotting[ssl_step,jj,:,1],vmin=0,vmax=24,cmap='hsv',marker='.')
        
        ssl_step=ssl_step+1
        
        for jj in range(27): 
            plt.scatter(full_north_plotting[ssl_step,jj,:,3],full_north_plotting[ssl_step,jj,:,2],transform=ccrs.PlateCarree(),c=full_north_plotting[ssl_step,jj,:,1],vmin=0,vmax=24,cmap='hsv',marker='.')
        
        plt.plot(full_north_plotting[ssl_step,3,:,3],full_north_plotting[ssl_step,3,:,2],transform=ccrs.PlateCarree(),c='black',linewidth=0.3)
    
        ssl_step=ssl_step+1
    
        for jj in range(27): 
            plt.scatter(full_north_plotting[ssl_step,jj,:,3],full_north_plotting[ssl_step,jj,:,2],transform=ccrs.PlateCarree(),c=full_north_plotting[ssl_step,jj,:,1],vmin=0,vmax=24,cmap='hsv',marker='.')
    






    
    # for jj in range(27): 
    #     plt.scatter(full_north_plotting[ssl_step,jj,:,3],full_north_plotting[ssl_step,jj,:,2],transform=ccrs.PlateCarree(),c=full_north_plotting[ssl_step,jj,:,1],vmin=0,vmax=24,cmap='hsv',marker='.')
    # # plt.scatter(sector1_lon150,sector1_lat150,transform=ccrs.PlateCarree(),c=sector1_loc150,vmin=0,vmax=24,cmap='hsv',marker='.')
    # plt.plot(full_north_plotting[ssl_step,3,:,3],full_north_plotting[ssl_step,3,:,2],transform=ccrs.PlateCarree(),c='black',linewidth=0.3)
    # # plt.plot(full_north_plotting[13,27,:,3],full_north_plotting[13,17,:,2],transform=ccrs.PlateCarree(),c='black',linewidth=0.3)
    # # plt.plot(full_north_plotting[16,27,:,3],full_north_plotting[16,17,:,2],transform=ccrs.PlateCarree(),c='blue',linewidth=0.3)
    plt.show()




def load_vogt_full():
    
    return full_north_plotting








def load_vogt_slices():

    
    sector1_lon=sector1_lon_0_ 
    sector1_lon=np.append(sector1_lon,sector1_lon_0_)
    sector1_lon=np.append(sector1_lon,sector1_lon_1_)
    sector1_lon=np.append(sector1_lon,sector1_lon_2_)
    sector1_lon=np.append(sector1_lon,sector1_lon_3_)
    sector1_lon=np.append(sector1_lon,sector1_lon_4_)
    sector1_lon=np.append(sector1_lon,sector1_lon_5_)
    sector1_lon=np.append(sector1_lon,sector1_lon_6_)
    sector1_lon=np.append(sector1_lon,sector1_lon_7_)
    sector1_lon=np.append(sector1_lon,sector1_lon_8_)
    sector1_lon=np.append(sector1_lon,sector1_lon_9_)
    sector1_lon=np.append(sector1_lon,sector1_lon_10)
    sector1_lon=np.append(sector1_lon,sector1_lon_11)
    sector1_lon=np.append(sector1_lon,sector1_lon_12)
    sector1_lon=np.append(sector1_lon,sector1_lon_13)
    sector1_lon=np.append(sector1_lon,sector1_lon_14)
    sector1_lon=np.append(sector1_lon,sector1_lon_15)
    sector1_lon=np.append(sector1_lon,sector1_lon_16)
    sector1_lon=np.append(sector1_lon,sector1_lon_17)
    sector1_lon=np.append(sector1_lon,sector1_lon_18)
    sector1_lon=np.append(sector1_lon,sector1_lon_19)
    sector1_lon=np.append(sector1_lon,sector1_lon_20)
    sector1_lon=np.append(sector1_lon,sector1_lon_21)
    sector1_lon=np.append(sector1_lon,sector1_lon_22)
    sector1_lon=np.append(sector1_lon,sector1_lon_23)
    sector1_lon=np.append(sector1_lon,sector1_lon_24)
    sector1_lon=np.append(sector1_lon,sector1_lon_25)
    sector1_lon=np.append(sector1_lon,sector1_lon_26)
    sector1_lon=np.append(sector1_lon,sector1_lon_27)

    sector1_lat=sector1_lat_0_ 
    sector1_lat=np.append(sector1_lat,sector1_lat_0_)
    sector1_lat=np.append(sector1_lat,sector1_lat_1_)
    sector1_lat=np.append(sector1_lat,sector1_lat_2_)
    sector1_lat=np.append(sector1_lat,sector1_lat_3_)
    sector1_lat=np.append(sector1_lat,sector1_lat_4_)
    sector1_lat=np.append(sector1_lat,sector1_lat_5_)
    sector1_lat=np.append(sector1_lat,sector1_lat_6_)
    sector1_lat=np.append(sector1_lat,sector1_lat_7_)
    sector1_lat=np.append(sector1_lat,sector1_lat_8_)
    sector1_lat=np.append(sector1_lat,sector1_lat_9_)
    sector1_lat=np.append(sector1_lat,sector1_lat_10)
    sector1_lat=np.append(sector1_lat,sector1_lat_11)
    sector1_lat=np.append(sector1_lat,sector1_lat_12)
    sector1_lat=np.append(sector1_lat,sector1_lat_13)
    sector1_lat=np.append(sector1_lat,sector1_lat_14)
    sector1_lat=np.append(sector1_lat,sector1_lat_15)
    sector1_lat=np.append(sector1_lat,sector1_lat_16)
    sector1_lat=np.append(sector1_lat,sector1_lat_17)
    sector1_lat=np.append(sector1_lat,sector1_lat_18)
    sector1_lat=np.append(sector1_lat,sector1_lat_19)
    sector1_lat=np.append(sector1_lat,sector1_lat_20)
    sector1_lat=np.append(sector1_lat,sector1_lat_21)
    sector1_lat=np.append(sector1_lat,sector1_lat_22)
    sector1_lat=np.append(sector1_lat,sector1_lat_23)
    sector1_lat=np.append(sector1_lat,sector1_lat_24)
    sector1_lat=np.append(sector1_lat,sector1_lat_25)
    sector1_lat=np.append(sector1_lat,sector1_lat_26)
    sector1_lat=np.append(sector1_lat,sector1_lat_27)
	
    sector1_loc=sector1_loc_0_ 
    sector1_loc=np.append(sector1_loc,sector1_loc_0_)
    sector1_loc=np.append(sector1_loc,sector1_loc_1_)
    sector1_loc=np.append(sector1_loc,sector1_loc_2_)
    sector1_loc=np.append(sector1_loc,sector1_loc_3_)
    sector1_loc=np.append(sector1_loc,sector1_loc_4_)
    sector1_loc=np.append(sector1_loc,sector1_loc_5_)
    sector1_loc=np.append(sector1_loc,sector1_loc_6_)
    sector1_loc=np.append(sector1_loc,sector1_loc_7_)
    sector1_loc=np.append(sector1_loc,sector1_loc_8_)
    sector1_loc=np.append(sector1_loc,sector1_loc_9_)
    sector1_loc=np.append(sector1_loc,sector1_loc_10)
    sector1_loc=np.append(sector1_loc,sector1_loc_11)
    sector1_loc=np.append(sector1_loc,sector1_loc_12)
    sector1_loc=np.append(sector1_loc,sector1_loc_13)
    sector1_loc=np.append(sector1_loc,sector1_loc_14)
    sector1_loc=np.append(sector1_loc,sector1_loc_15)
    sector1_loc=np.append(sector1_loc,sector1_loc_16)
    sector1_loc=np.append(sector1_loc,sector1_loc_17)
    sector1_loc=np.append(sector1_loc,sector1_loc_18)
    sector1_loc=np.append(sector1_loc,sector1_loc_19)
    sector1_loc=np.append(sector1_loc,sector1_loc_20)
    sector1_loc=np.append(sector1_loc,sector1_loc_21)
    sector1_loc=np.append(sector1_loc,sector1_loc_22)
    sector1_loc=np.append(sector1_loc,sector1_loc_23)
    sector1_loc=np.append(sector1_loc,sector1_loc_24)
    sector1_loc=np.append(sector1_loc,sector1_loc_25)
    sector1_loc=np.append(sector1_loc,sector1_loc_26)
    sector1_loc=np.append(sector1_loc,sector1_loc_27)
	
    sector1_dis=sector1_dis_0_ 
    sector1_dis=np.append(sector1_dis,sector1_dis_0_)
    sector1_dis=np.append(sector1_dis,sector1_dis_1_)
    sector1_dis=np.append(sector1_dis,sector1_dis_2_)
    sector1_dis=np.append(sector1_dis,sector1_dis_3_)
    sector1_dis=np.append(sector1_dis,sector1_dis_4_)
    sector1_dis=np.append(sector1_dis,sector1_dis_5_)
    sector1_dis=np.append(sector1_dis,sector1_dis_6_)
    sector1_dis=np.append(sector1_dis,sector1_dis_7_)
    sector1_dis=np.append(sector1_dis,sector1_dis_8_)
    sector1_dis=np.append(sector1_dis,sector1_dis_9_)
    sector1_dis=np.append(sector1_dis,sector1_dis_10)
    sector1_dis=np.append(sector1_dis,sector1_dis_11)
    sector1_dis=np.append(sector1_dis,sector1_dis_12)
    sector1_dis=np.append(sector1_dis,sector1_dis_13)
    sector1_dis=np.append(sector1_dis,sector1_dis_14)
    sector1_dis=np.append(sector1_dis,sector1_dis_15)
    sector1_dis=np.append(sector1_dis,sector1_dis_16)
    sector1_dis=np.append(sector1_dis,sector1_dis_17)
    sector1_dis=np.append(sector1_dis,sector1_dis_18)
    sector1_dis=np.append(sector1_dis,sector1_dis_19)
    sector1_dis=np.append(sector1_dis,sector1_dis_20)
    sector1_dis=np.append(sector1_dis,sector1_dis_21)
    sector1_dis=np.append(sector1_dis,sector1_dis_22)
    sector1_dis=np.append(sector1_dis,sector1_dis_23)
    sector1_dis=np.append(sector1_dis,sector1_dis_24)
    sector1_dis=np.append(sector1_dis,sector1_dis_25)
    sector1_dis=np.append(sector1_dis,sector1_dis_26)
    sector1_dis=np.append(sector1_dis,sector1_dis_27)
	
    sector2_lon=sector2_lon_0_ 
    sector2_lon=np.append(sector2_lon,sector2_lon_0_)
    sector2_lon=np.append(sector2_lon,sector2_lon_1_)
    sector2_lon=np.append(sector2_lon,sector2_lon_2_)
    sector2_lon=np.append(sector2_lon,sector2_lon_3_)
    sector2_lon=np.append(sector2_lon,sector2_lon_4_)
    sector2_lon=np.append(sector2_lon,sector2_lon_5_)
    sector2_lon=np.append(sector2_lon,sector2_lon_6_)
    sector2_lon=np.append(sector2_lon,sector2_lon_7_)
    sector2_lon=np.append(sector2_lon,sector2_lon_8_)
    sector2_lon=np.append(sector2_lon,sector2_lon_9_)
    sector2_lon=np.append(sector2_lon,sector2_lon_10)
    sector2_lon=np.append(sector2_lon,sector2_lon_11)
    sector2_lon=np.append(sector2_lon,sector2_lon_12)
    sector2_lon=np.append(sector2_lon,sector2_lon_13)
    sector2_lon=np.append(sector2_lon,sector2_lon_14)
    sector2_lon=np.append(sector2_lon,sector2_lon_15)
    sector2_lon=np.append(sector2_lon,sector2_lon_16)
    sector2_lon=np.append(sector2_lon,sector2_lon_17)
    sector2_lon=np.append(sector2_lon,sector2_lon_18)
    sector2_lon=np.append(sector2_lon,sector2_lon_19)
    sector2_lon=np.append(sector2_lon,sector2_lon_20)
    sector2_lon=np.append(sector2_lon,sector2_lon_21)
    sector2_lon=np.append(sector2_lon,sector2_lon_22)
    sector2_lon=np.append(sector2_lon,sector2_lon_23)
    sector2_lon=np.append(sector2_lon,sector2_lon_24)
    sector2_lon=np.append(sector2_lon,sector2_lon_25)
    sector2_lon=np.append(sector2_lon,sector2_lon_26)
    sector2_lon=np.append(sector2_lon,sector2_lon_27)

    sector2_lat=sector2_lat_0_ 
    sector2_lat=np.append(sector2_lat,sector2_lat_0_)
    sector2_lat=np.append(sector2_lat,sector2_lat_1_)
    sector2_lat=np.append(sector2_lat,sector2_lat_2_)
    sector2_lat=np.append(sector2_lat,sector2_lat_3_)
    sector2_lat=np.append(sector2_lat,sector2_lat_4_)
    sector2_lat=np.append(sector2_lat,sector2_lat_5_)
    sector2_lat=np.append(sector2_lat,sector2_lat_6_)
    sector2_lat=np.append(sector2_lat,sector2_lat_7_)
    sector2_lat=np.append(sector2_lat,sector2_lat_8_)
    sector2_lat=np.append(sector2_lat,sector2_lat_9_)
    sector2_lat=np.append(sector2_lat,sector2_lat_10)
    sector2_lat=np.append(sector2_lat,sector2_lat_11)
    sector2_lat=np.append(sector2_lat,sector2_lat_12)
    sector2_lat=np.append(sector2_lat,sector2_lat_13)
    sector2_lat=np.append(sector2_lat,sector2_lat_14)
    sector2_lat=np.append(sector2_lat,sector2_lat_15)
    sector2_lat=np.append(sector2_lat,sector2_lat_16)
    sector2_lat=np.append(sector2_lat,sector2_lat_17)
    sector2_lat=np.append(sector2_lat,sector2_lat_18)
    sector2_lat=np.append(sector2_lat,sector2_lat_19)
    sector2_lat=np.append(sector2_lat,sector2_lat_20)
    sector2_lat=np.append(sector2_lat,sector2_lat_21)
    sector2_lat=np.append(sector2_lat,sector2_lat_22)
    sector2_lat=np.append(sector2_lat,sector2_lat_23)
    sector2_lat=np.append(sector2_lat,sector2_lat_24)
    sector2_lat=np.append(sector2_lat,sector2_lat_25)
    sector2_lat=np.append(sector2_lat,sector2_lat_26)
    sector2_lat=np.append(sector2_lat,sector2_lat_27)
	
    sector2_loc=sector2_loc_0_ 
    sector2_loc=np.append(sector2_loc,sector2_loc_0_)
    sector2_loc=np.append(sector2_loc,sector2_loc_1_)
    sector2_loc=np.append(sector2_loc,sector2_loc_2_)
    sector2_loc=np.append(sector2_loc,sector2_loc_3_)
    sector2_loc=np.append(sector2_loc,sector2_loc_4_)
    sector2_loc=np.append(sector2_loc,sector2_loc_5_)
    sector2_loc=np.append(sector2_loc,sector2_loc_6_)
    sector2_loc=np.append(sector2_loc,sector2_loc_7_)
    sector2_loc=np.append(sector2_loc,sector2_loc_8_)
    sector2_loc=np.append(sector2_loc,sector2_loc_9_)
    sector2_loc=np.append(sector2_loc,sector2_loc_10)
    sector2_loc=np.append(sector2_loc,sector2_loc_11)
    sector2_loc=np.append(sector2_loc,sector2_loc_12)
    sector2_loc=np.append(sector2_loc,sector2_loc_13)
    sector2_loc=np.append(sector2_loc,sector2_loc_14)
    sector2_loc=np.append(sector2_loc,sector2_loc_15)
    sector2_loc=np.append(sector2_loc,sector2_loc_16)
    sector2_loc=np.append(sector2_loc,sector2_loc_17)
    sector2_loc=np.append(sector2_loc,sector2_loc_18)
    sector2_loc=np.append(sector2_loc,sector2_loc_19)
    sector2_loc=np.append(sector2_loc,sector2_loc_20)
    sector2_loc=np.append(sector2_loc,sector2_loc_21)
    sector2_loc=np.append(sector2_loc,sector2_loc_22)
    sector2_loc=np.append(sector2_loc,sector2_loc_23)
    sector2_loc=np.append(sector2_loc,sector2_loc_24)
    sector2_loc=np.append(sector2_loc,sector2_loc_25)
    sector2_loc=np.append(sector2_loc,sector2_loc_26)
    sector2_loc=np.append(sector2_loc,sector2_loc_27)

    sector2_dis=sector2_dis_0_ 
    sector2_dis=np.append(sector2_dis,sector2_dis_0_)
    sector2_dis=np.append(sector2_dis,sector2_dis_1_)
    sector2_dis=np.append(sector2_dis,sector2_dis_2_)
    sector2_dis=np.append(sector2_dis,sector2_dis_3_)
    sector2_dis=np.append(sector2_dis,sector2_dis_4_)
    sector2_dis=np.append(sector2_dis,sector2_dis_5_)
    sector2_dis=np.append(sector2_dis,sector2_dis_6_)
    sector2_dis=np.append(sector2_dis,sector2_dis_7_)
    sector2_dis=np.append(sector2_dis,sector2_dis_8_)
    sector2_dis=np.append(sector2_dis,sector2_dis_9_)
    sector2_dis=np.append(sector2_dis,sector2_dis_10)
    sector2_dis=np.append(sector2_dis,sector2_dis_11)
    sector2_dis=np.append(sector2_dis,sector2_dis_12)
    sector2_dis=np.append(sector2_dis,sector2_dis_13)
    sector2_dis=np.append(sector2_dis,sector2_dis_14)
    sector2_dis=np.append(sector2_dis,sector2_dis_15)
    sector2_dis=np.append(sector2_dis,sector2_dis_16)
    sector2_dis=np.append(sector2_dis,sector2_dis_17)
    sector2_dis=np.append(sector2_dis,sector2_dis_18)
    sector2_dis=np.append(sector2_dis,sector2_dis_19)
    sector2_dis=np.append(sector2_dis,sector2_dis_20)
    sector2_dis=np.append(sector2_dis,sector2_dis_21)
    sector2_dis=np.append(sector2_dis,sector2_dis_22)
    sector2_dis=np.append(sector2_dis,sector2_dis_23)
    sector2_dis=np.append(sector2_dis,sector2_dis_24)
    sector2_dis=np.append(sector2_dis,sector2_dis_25)
    sector2_dis=np.append(sector2_dis,sector2_dis_26)
    sector2_dis=np.append(sector2_dis,sector2_dis_27)
	
    
    sector3_lon=sector3_lon_0_ 
    sector3_lon=np.append(sector3_lon,sector3_lon_0_)
    sector3_lon=np.append(sector3_lon,sector3_lon_1_)
    sector3_lon=np.append(sector3_lon,sector3_lon_2_)
    sector3_lon=np.append(sector3_lon,sector3_lon_3_)
    sector3_lon=np.append(sector3_lon,sector3_lon_4_)
    sector3_lon=np.append(sector3_lon,sector3_lon_5_)
    sector3_lon=np.append(sector3_lon,sector3_lon_6_)
    sector3_lon=np.append(sector3_lon,sector3_lon_7_)
    sector3_lon=np.append(sector3_lon,sector3_lon_8_)
    sector3_lon=np.append(sector3_lon,sector3_lon_9_)
    sector3_lon=np.append(sector3_lon,sector3_lon_10)
    sector3_lon=np.append(sector3_lon,sector3_lon_11)
    sector3_lon=np.append(sector3_lon,sector3_lon_12)
    sector3_lon=np.append(sector3_lon,sector3_lon_13)
    sector3_lon=np.append(sector3_lon,sector3_lon_14)
    sector3_lon=np.append(sector3_lon,sector3_lon_15)
    sector3_lon=np.append(sector3_lon,sector3_lon_16)
    sector3_lon=np.append(sector3_lon,sector3_lon_17)
    sector3_lon=np.append(sector3_lon,sector3_lon_18)
    sector3_lon=np.append(sector3_lon,sector3_lon_19)
    sector3_lon=np.append(sector3_lon,sector3_lon_20)
    sector3_lon=np.append(sector3_lon,sector3_lon_21)
    sector3_lon=np.append(sector3_lon,sector3_lon_22)
    sector3_lon=np.append(sector3_lon,sector3_lon_23)
    sector3_lon=np.append(sector3_lon,sector3_lon_24)
    sector3_lon=np.append(sector3_lon,sector3_lon_25)
    sector3_lon=np.append(sector3_lon,sector3_lon_26)
    sector3_lon=np.append(sector3_lon,sector3_lon_27)

    sector3_lat=sector3_lat_0_ 
    sector3_lat=np.append(sector3_lat,sector3_lat_0_)
    sector3_lat=np.append(sector3_lat,sector3_lat_1_)
    sector3_lat=np.append(sector3_lat,sector3_lat_2_)
    sector3_lat=np.append(sector3_lat,sector3_lat_3_)
    sector3_lat=np.append(sector3_lat,sector3_lat_4_)
    sector3_lat=np.append(sector3_lat,sector3_lat_5_)
    sector3_lat=np.append(sector3_lat,sector3_lat_6_)
    sector3_lat=np.append(sector3_lat,sector3_lat_7_)
    sector3_lat=np.append(sector3_lat,sector3_lat_8_)
    sector3_lat=np.append(sector3_lat,sector3_lat_9_)
    sector3_lat=np.append(sector3_lat,sector3_lat_10)
    sector3_lat=np.append(sector3_lat,sector3_lat_11)
    sector3_lat=np.append(sector3_lat,sector3_lat_12)
    sector3_lat=np.append(sector3_lat,sector3_lat_13)
    sector3_lat=np.append(sector3_lat,sector3_lat_14)
    sector3_lat=np.append(sector3_lat,sector3_lat_15)
    sector3_lat=np.append(sector3_lat,sector3_lat_16)
    sector3_lat=np.append(sector3_lat,sector3_lat_17)
    sector3_lat=np.append(sector3_lat,sector3_lat_18)
    sector3_lat=np.append(sector3_lat,sector3_lat_19)
    sector3_lat=np.append(sector3_lat,sector3_lat_20)
    sector3_lat=np.append(sector3_lat,sector3_lat_21)
    sector3_lat=np.append(sector3_lat,sector3_lat_22)
    sector3_lat=np.append(sector3_lat,sector3_lat_23)
    sector3_lat=np.append(sector3_lat,sector3_lat_24)
    sector3_lat=np.append(sector3_lat,sector3_lat_25)
    sector3_lat=np.append(sector3_lat,sector3_lat_26)
    sector3_lat=np.append(sector3_lat,sector3_lat_27)
	
    sector3_loc=sector3_loc_0_ 
    sector3_loc=np.append(sector3_loc,sector3_loc_0_)
    sector3_loc=np.append(sector3_loc,sector3_loc_1_)
    sector3_loc=np.append(sector3_loc,sector3_loc_2_)
    sector3_loc=np.append(sector3_loc,sector3_loc_3_)
    sector3_loc=np.append(sector3_loc,sector3_loc_4_)
    sector3_loc=np.append(sector3_loc,sector3_loc_5_)
    sector3_loc=np.append(sector3_loc,sector3_loc_6_)
    sector3_loc=np.append(sector3_loc,sector3_loc_7_)
    sector3_loc=np.append(sector3_loc,sector3_loc_8_)
    sector3_loc=np.append(sector3_loc,sector3_loc_9_)
    sector3_loc=np.append(sector3_loc,sector3_loc_10)
    sector3_loc=np.append(sector3_loc,sector3_loc_11)
    sector3_loc=np.append(sector3_loc,sector3_loc_12)
    sector3_loc=np.append(sector3_loc,sector3_loc_13)
    sector3_loc=np.append(sector3_loc,sector3_loc_14)
    sector3_loc=np.append(sector3_loc,sector3_loc_15)
    sector3_loc=np.append(sector3_loc,sector3_loc_16)
    sector3_loc=np.append(sector3_loc,sector3_loc_17)
    sector3_loc=np.append(sector3_loc,sector3_loc_18)
    sector3_loc=np.append(sector3_loc,sector3_loc_19)
    sector3_loc=np.append(sector3_loc,sector3_loc_20)
    sector3_loc=np.append(sector3_loc,sector3_loc_21)
    sector3_loc=np.append(sector3_loc,sector3_loc_22)
    sector3_loc=np.append(sector3_loc,sector3_loc_23)
    sector3_loc=np.append(sector3_loc,sector3_loc_24)
    sector3_loc=np.append(sector3_loc,sector3_loc_25)
    sector3_loc=np.append(sector3_loc,sector3_loc_26)
    sector3_loc=np.append(sector3_loc,sector3_loc_27)

    sector3_dis=sector3_dis_0_ 
    sector3_dis=np.append(sector3_dis,sector3_dis_0_)
    sector3_dis=np.append(sector3_dis,sector3_dis_1_)
    sector3_dis=np.append(sector3_dis,sector3_dis_2_)
    sector3_dis=np.append(sector3_dis,sector3_dis_3_)
    sector3_dis=np.append(sector3_dis,sector3_dis_4_)
    sector3_dis=np.append(sector3_dis,sector3_dis_5_)
    sector3_dis=np.append(sector3_dis,sector3_dis_6_)
    sector3_dis=np.append(sector3_dis,sector3_dis_7_)
    sector3_dis=np.append(sector3_dis,sector3_dis_8_)
    sector3_dis=np.append(sector3_dis,sector3_dis_9_)
    sector3_dis=np.append(sector3_dis,sector3_dis_10)
    sector3_dis=np.append(sector3_dis,sector3_dis_11)
    sector3_dis=np.append(sector3_dis,sector3_dis_12)
    sector3_dis=np.append(sector3_dis,sector3_dis_13)
    sector3_dis=np.append(sector3_dis,sector3_dis_14)
    sector3_dis=np.append(sector3_dis,sector3_dis_15)
    sector3_dis=np.append(sector3_dis,sector3_dis_16)
    sector3_dis=np.append(sector3_dis,sector3_dis_17)
    sector3_dis=np.append(sector3_dis,sector3_dis_18)
    sector3_dis=np.append(sector3_dis,sector3_dis_19)
    sector3_dis=np.append(sector3_dis,sector3_dis_20)
    sector3_dis=np.append(sector3_dis,sector3_dis_21)
    sector3_dis=np.append(sector3_dis,sector3_dis_22)
    sector3_dis=np.append(sector3_dis,sector3_dis_23)
    sector3_dis=np.append(sector3_dis,sector3_dis_24)
    sector3_dis=np.append(sector3_dis,sector3_dis_25)
    sector3_dis=np.append(sector3_dis,sector3_dis_26)
    sector3_dis=np.append(sector3_dis,sector3_dis_27)
	
    
    sector4_lon=sector4_lon_0_ 
    sector4_lon=np.append(sector4_lon,sector4_lon_0_)
    sector4_lon=np.append(sector4_lon,sector4_lon_1_)
    sector4_lon=np.append(sector4_lon,sector4_lon_2_)
    sector4_lon=np.append(sector4_lon,sector4_lon_3_)
    sector4_lon=np.append(sector4_lon,sector4_lon_4_)
    sector4_lon=np.append(sector4_lon,sector4_lon_5_)
    sector4_lon=np.append(sector4_lon,sector4_lon_6_)
    sector4_lon=np.append(sector4_lon,sector4_lon_7_)
    sector4_lon=np.append(sector4_lon,sector4_lon_8_)
    sector4_lon=np.append(sector4_lon,sector4_lon_9_)
    sector4_lon=np.append(sector4_lon,sector4_lon_10)
    sector4_lon=np.append(sector4_lon,sector4_lon_11)
    sector4_lon=np.append(sector4_lon,sector4_lon_12)
    sector4_lon=np.append(sector4_lon,sector4_lon_13)
    sector4_lon=np.append(sector4_lon,sector4_lon_14)
    sector4_lon=np.append(sector4_lon,sector4_lon_15)
    sector4_lon=np.append(sector4_lon,sector4_lon_16)
    sector4_lon=np.append(sector4_lon,sector4_lon_17)
    sector4_lon=np.append(sector4_lon,sector4_lon_18)
    sector4_lon=np.append(sector4_lon,sector4_lon_19)
    sector4_lon=np.append(sector4_lon,sector4_lon_20)
    sector4_lon=np.append(sector4_lon,sector4_lon_21)
    sector4_lon=np.append(sector4_lon,sector4_lon_22)
    sector4_lon=np.append(sector4_lon,sector4_lon_23)
    sector4_lon=np.append(sector4_lon,sector4_lon_24)
    sector4_lon=np.append(sector4_lon,sector4_lon_25)
    sector4_lon=np.append(sector4_lon,sector4_lon_26)
    sector4_lon=np.append(sector4_lon,sector4_lon_27)

    sector4_lat=sector4_lat_0_ 
    sector4_lat=np.append(sector4_lat,sector4_lat_0_)
    sector4_lat=np.append(sector4_lat,sector4_lat_1_)
    sector4_lat=np.append(sector4_lat,sector4_lat_2_)
    sector4_lat=np.append(sector4_lat,sector4_lat_3_)
    sector4_lat=np.append(sector4_lat,sector4_lat_4_)
    sector4_lat=np.append(sector4_lat,sector4_lat_5_)
    sector4_lat=np.append(sector4_lat,sector4_lat_6_)
    sector4_lat=np.append(sector4_lat,sector4_lat_7_)
    sector4_lat=np.append(sector4_lat,sector4_lat_8_)
    sector4_lat=np.append(sector4_lat,sector4_lat_9_)
    sector4_lat=np.append(sector4_lat,sector4_lat_10)
    sector4_lat=np.append(sector4_lat,sector4_lat_11)
    sector4_lat=np.append(sector4_lat,sector4_lat_12)
    sector4_lat=np.append(sector4_lat,sector4_lat_13)
    sector4_lat=np.append(sector4_lat,sector4_lat_14)
    sector4_lat=np.append(sector4_lat,sector4_lat_15)
    sector4_lat=np.append(sector4_lat,sector4_lat_16)
    sector4_lat=np.append(sector4_lat,sector4_lat_17)
    sector4_lat=np.append(sector4_lat,sector4_lat_18)
    sector4_lat=np.append(sector4_lat,sector4_lat_19)
    sector4_lat=np.append(sector4_lat,sector4_lat_20)
    sector4_lat=np.append(sector4_lat,sector4_lat_21)
    sector4_lat=np.append(sector4_lat,sector4_lat_22)
    sector4_lat=np.append(sector4_lat,sector4_lat_23)
    sector4_lat=np.append(sector4_lat,sector4_lat_24)
    sector4_lat=np.append(sector4_lat,sector4_lat_25)
    sector4_lat=np.append(sector4_lat,sector4_lat_26)
    sector4_lat=np.append(sector4_lat,sector4_lat_27)
	
    sector4_loc=sector4_loc_0_ 
    sector4_loc=np.append(sector4_loc,sector4_loc_0_)
    sector4_loc=np.append(sector4_loc,sector4_loc_1_)
    sector4_loc=np.append(sector4_loc,sector4_loc_2_)
    sector4_loc=np.append(sector4_loc,sector4_loc_3_)
    sector4_loc=np.append(sector4_loc,sector4_loc_4_)
    sector4_loc=np.append(sector4_loc,sector4_loc_5_)
    sector4_loc=np.append(sector4_loc,sector4_loc_6_)
    sector4_loc=np.append(sector4_loc,sector4_loc_7_)
    sector4_loc=np.append(sector4_loc,sector4_loc_8_)
    sector4_loc=np.append(sector4_loc,sector4_loc_9_)
    sector4_loc=np.append(sector4_loc,sector4_loc_10)
    sector4_loc=np.append(sector4_loc,sector4_loc_11)
    sector4_loc=np.append(sector4_loc,sector4_loc_12)
    sector4_loc=np.append(sector4_loc,sector4_loc_13)
    sector4_loc=np.append(sector4_loc,sector4_loc_14)
    sector4_loc=np.append(sector4_loc,sector4_loc_15)
    sector4_loc=np.append(sector4_loc,sector4_loc_16)
    sector4_loc=np.append(sector4_loc,sector4_loc_17)
    sector4_loc=np.append(sector4_loc,sector4_loc_18)
    sector4_loc=np.append(sector4_loc,sector4_loc_19)
    sector4_loc=np.append(sector4_loc,sector4_loc_20)
    sector4_loc=np.append(sector4_loc,sector4_loc_21)
    sector4_loc=np.append(sector4_loc,sector4_loc_22)
    sector4_loc=np.append(sector4_loc,sector4_loc_23)
    sector4_loc=np.append(sector4_loc,sector4_loc_24)
    sector4_loc=np.append(sector4_loc,sector4_loc_25)
    sector4_loc=np.append(sector4_loc,sector4_loc_26)
    sector4_loc=np.append(sector4_loc,sector4_loc_27)
	
    sector4_dis=sector4_dis_0_ 
    sector4_dis=np.append(sector4_dis,sector4_dis_0_)
    sector4_dis=np.append(sector4_dis,sector4_dis_1_)
    sector4_dis=np.append(sector4_dis,sector4_dis_2_)
    sector4_dis=np.append(sector4_dis,sector4_dis_3_)
    sector4_dis=np.append(sector4_dis,sector4_dis_4_)
    sector4_dis=np.append(sector4_dis,sector4_dis_5_)
    sector4_dis=np.append(sector4_dis,sector4_dis_6_)
    sector4_dis=np.append(sector4_dis,sector4_dis_7_)
    sector4_dis=np.append(sector4_dis,sector4_dis_8_)
    sector4_dis=np.append(sector4_dis,sector4_dis_9_)
    sector4_dis=np.append(sector4_dis,sector4_dis_10)
    sector4_dis=np.append(sector4_dis,sector4_dis_11)
    sector4_dis=np.append(sector4_dis,sector4_dis_12)
    sector4_dis=np.append(sector4_dis,sector4_dis_13)
    sector4_dis=np.append(sector4_dis,sector4_dis_14)
    sector4_dis=np.append(sector4_dis,sector4_dis_15)
    sector4_dis=np.append(sector4_dis,sector4_dis_16)
    sector4_dis=np.append(sector4_dis,sector4_dis_17)
    sector4_dis=np.append(sector4_dis,sector4_dis_18)
    sector4_dis=np.append(sector4_dis,sector4_dis_19)
    sector4_dis=np.append(sector4_dis,sector4_dis_20)
    sector4_dis=np.append(sector4_dis,sector4_dis_21)
    sector4_dis=np.append(sector4_dis,sector4_dis_22)
    sector4_dis=np.append(sector4_dis,sector4_dis_23)
    sector4_dis=np.append(sector4_dis,sector4_dis_24)
    sector4_dis=np.append(sector4_dis,sector4_dis_25)
    sector4_dis=np.append(sector4_dis,sector4_dis_26)
    sector4_dis=np.append(sector4_dis,sector4_dis_27)
    
    
    sector5_lon=sector5_lon_0_ 
    sector5_lon=np.append(sector5_lon,sector5_lon_0_)
    sector5_lon=np.append(sector5_lon,sector5_lon_1_)
    sector5_lon=np.append(sector5_lon,sector5_lon_2_)
    sector5_lon=np.append(sector5_lon,sector5_lon_3_)
    sector5_lon=np.append(sector5_lon,sector5_lon_4_)
    sector5_lon=np.append(sector5_lon,sector5_lon_5_)
    sector5_lon=np.append(sector5_lon,sector5_lon_6_)
    sector5_lon=np.append(sector5_lon,sector5_lon_7_)
    sector5_lon=np.append(sector5_lon,sector5_lon_8_)
    sector5_lon=np.append(sector5_lon,sector5_lon_9_)
    sector5_lon=np.append(sector5_lon,sector5_lon_10)
    sector5_lon=np.append(sector5_lon,sector5_lon_11)
    sector5_lon=np.append(sector5_lon,sector5_lon_12)
    sector5_lon=np.append(sector5_lon,sector5_lon_13)
    sector5_lon=np.append(sector5_lon,sector5_lon_14)
    sector5_lon=np.append(sector5_lon,sector5_lon_15)
    sector5_lon=np.append(sector5_lon,sector5_lon_16)
    sector5_lon=np.append(sector5_lon,sector5_lon_17)
    sector5_lon=np.append(sector5_lon,sector5_lon_18)
    sector5_lon=np.append(sector5_lon,sector5_lon_19)
    sector5_lon=np.append(sector5_lon,sector5_lon_20)
    sector5_lon=np.append(sector5_lon,sector5_lon_21)
    sector5_lon=np.append(sector5_lon,sector5_lon_22)
    sector5_lon=np.append(sector5_lon,sector5_lon_23)
    sector5_lon=np.append(sector5_lon,sector5_lon_24)
    sector5_lon=np.append(sector5_lon,sector5_lon_25)
    sector5_lon=np.append(sector5_lon,sector5_lon_26)
    sector5_lon=np.append(sector5_lon,sector5_lon_27)

    sector5_lat=sector5_lat_0_ 
    sector5_lat=np.append(sector5_lat,sector5_lat_0_)
    sector5_lat=np.append(sector5_lat,sector5_lat_1_)
    sector5_lat=np.append(sector5_lat,sector5_lat_2_)
    sector5_lat=np.append(sector5_lat,sector5_lat_3_)
    sector5_lat=np.append(sector5_lat,sector5_lat_4_)
    sector5_lat=np.append(sector5_lat,sector5_lat_5_)
    sector5_lat=np.append(sector5_lat,sector5_lat_6_)
    sector5_lat=np.append(sector5_lat,sector5_lat_7_)
    sector5_lat=np.append(sector5_lat,sector5_lat_8_)
    sector5_lat=np.append(sector5_lat,sector5_lat_9_)
    sector5_lat=np.append(sector5_lat,sector5_lat_10)
    sector5_lat=np.append(sector5_lat,sector5_lat_11)
    sector5_lat=np.append(sector5_lat,sector5_lat_12)
    sector5_lat=np.append(sector5_lat,sector5_lat_13)
    sector5_lat=np.append(sector5_lat,sector5_lat_14)
    sector5_lat=np.append(sector5_lat,sector5_lat_15)
    sector5_lat=np.append(sector5_lat,sector5_lat_16)
    sector5_lat=np.append(sector5_lat,sector5_lat_17)
    sector5_lat=np.append(sector5_lat,sector5_lat_18)
    sector5_lat=np.append(sector5_lat,sector5_lat_19)
    sector5_lat=np.append(sector5_lat,sector5_lat_20)
    sector5_lat=np.append(sector5_lat,sector5_lat_21)
    sector5_lat=np.append(sector5_lat,sector5_lat_22)
    sector5_lat=np.append(sector5_lat,sector5_lat_23)
    sector5_lat=np.append(sector5_lat,sector5_lat_24)
    sector5_lat=np.append(sector5_lat,sector5_lat_25)
    sector5_lat=np.append(sector5_lat,sector5_lat_26)
    sector5_lat=np.append(sector5_lat,sector5_lat_27)
	
    sector5_loc=sector5_loc_0_ 
    sector5_loc=np.append(sector5_loc,sector5_loc_0_)
    sector5_loc=np.append(sector5_loc,sector5_loc_1_)
    sector5_loc=np.append(sector5_loc,sector5_loc_2_)
    sector5_loc=np.append(sector5_loc,sector5_loc_3_)
    sector5_loc=np.append(sector5_loc,sector5_loc_4_)
    sector5_loc=np.append(sector5_loc,sector5_loc_5_)
    sector5_loc=np.append(sector5_loc,sector5_loc_6_)
    sector5_loc=np.append(sector5_loc,sector5_loc_7_)
    sector5_loc=np.append(sector5_loc,sector5_loc_8_)
    sector5_loc=np.append(sector5_loc,sector5_loc_9_)
    sector5_loc=np.append(sector5_loc,sector5_loc_10)
    sector5_loc=np.append(sector5_loc,sector5_loc_11)
    sector5_loc=np.append(sector5_loc,sector5_loc_12)
    sector5_loc=np.append(sector5_loc,sector5_loc_13)
    sector5_loc=np.append(sector5_loc,sector5_loc_14)
    sector5_loc=np.append(sector5_loc,sector5_loc_15)
    sector5_loc=np.append(sector5_loc,sector5_loc_16)
    sector5_loc=np.append(sector5_loc,sector5_loc_17)
    sector5_loc=np.append(sector5_loc,sector5_loc_18)
    sector5_loc=np.append(sector5_loc,sector5_loc_19)
    sector5_loc=np.append(sector5_loc,sector5_loc_20)
    sector5_loc=np.append(sector5_loc,sector5_loc_21)
    sector5_loc=np.append(sector5_loc,sector5_loc_22)
    sector5_loc=np.append(sector5_loc,sector5_loc_23)
    sector5_loc=np.append(sector5_loc,sector5_loc_24)
    sector5_loc=np.append(sector5_loc,sector5_loc_25)
    sector5_loc=np.append(sector5_loc,sector5_loc_26)
    sector5_loc=np.append(sector5_loc,sector5_loc_27)
	
    sector5_dis=sector5_dis_0_ 
    sector5_dis=np.append(sector5_dis,sector5_dis_0_)
    sector5_dis=np.append(sector5_dis,sector5_dis_1_)
    sector5_dis=np.append(sector5_dis,sector5_dis_2_)
    sector5_dis=np.append(sector5_dis,sector5_dis_3_)
    sector5_dis=np.append(sector5_dis,sector5_dis_4_)
    sector5_dis=np.append(sector5_dis,sector5_dis_5_)
    sector5_dis=np.append(sector5_dis,sector5_dis_6_)
    sector5_dis=np.append(sector5_dis,sector5_dis_7_)
    sector5_dis=np.append(sector5_dis,sector5_dis_8_)
    sector5_dis=np.append(sector5_dis,sector5_dis_9_)
    sector5_dis=np.append(sector5_dis,sector5_dis_10)
    sector5_dis=np.append(sector5_dis,sector5_dis_11)
    sector5_dis=np.append(sector5_dis,sector5_dis_12)
    sector5_dis=np.append(sector5_dis,sector5_dis_13)
    sector5_dis=np.append(sector5_dis,sector5_dis_14)
    sector5_dis=np.append(sector5_dis,sector5_dis_15)
    sector5_dis=np.append(sector5_dis,sector5_dis_16)
    sector5_dis=np.append(sector5_dis,sector5_dis_17)
    sector5_dis=np.append(sector5_dis,sector5_dis_18)
    sector5_dis=np.append(sector5_dis,sector5_dis_19)
    sector5_dis=np.append(sector5_dis,sector5_dis_20)
    sector5_dis=np.append(sector5_dis,sector5_dis_21)
    sector5_dis=np.append(sector5_dis,sector5_dis_22)
    sector5_dis=np.append(sector5_dis,sector5_dis_23)
    sector5_dis=np.append(sector5_dis,sector5_dis_24)
    sector5_dis=np.append(sector5_dis,sector5_dis_25)
    sector5_dis=np.append(sector5_dis,sector5_dis_26)
    sector5_dis=np.append(sector5_dis,sector5_dis_27)
		    

    return sector1_lon,sector1_lat,sector1_loc,sector1_dis,              sector2_lon,sector2_lat,sector2_loc,sector2_dis,              sector3_lon,sector3_lat,sector3_loc,sector3_dis,              sector4_lon,sector4_lat,sector4_loc,sector4_dis,              sector5_lon,sector5_lat,sector5_loc,sector5_dis

    

def plot_vogt_slices(ynum,ypos,runhere=True):
    
    ypos=(ypos-1)*6
    
    # fig = plt.figure(figsize=(12,              2),dpi=300)
    
    subsolarlongitude=120
    
    
    ssl_step=int(subsolarlongitude/10)
    crs = ccrs.RotatedPole(globe=ccrs.Globe(flattening=(0.0)))
    
    ax1 = plt.subplot(ynum,              6,              ypos+5,projection=ccrs.Orthographic(360-cml,              js))
    # ax1 = plt.subplot2grid((11,1),              (0,0),              colspan=2,projection=ccrs.Orthographic(360-cml,              js))
    
    # ax.set_global()
    # ax.add_feature(jup_night(subsolarlat,360-subsolarlongitude,              alpha=0.2))
    
    gl = ax1.gridlines(crs=ccrs.PlateCarree(),              linewidth=1,              color='black',              alpha=0.5,              linestyle='dotted',              draw_labels=True)
    # gl.xlocator = mticker.FixedLocator(np.arange(18)*20-180)
    # gl.ylocator = mticker.FixedLocator(np.arange(9)*20-90)
    
    
    ax1.scatter(sector1_lon_0_,sector1_lat_0_,transform=ccrs.PlateCarree(),c=sector1_loc_0_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_1_,sector1_lat_1_,transform=ccrs.PlateCarree(),c=sector1_loc_1_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_2_,sector1_lat_2_,transform=ccrs.PlateCarree(),c=sector1_loc_2_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_3_,sector1_lat_3_,transform=ccrs.PlateCarree(),c=sector1_loc_3_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_4_,sector1_lat_4_,transform=ccrs.PlateCarree(),c=sector1_loc_4_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_5_,sector1_lat_5_,transform=ccrs.PlateCarree(),c=sector1_loc_5_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_6_,sector1_lat_6_,transform=ccrs.PlateCarree(),c=sector1_loc_6_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_7_,sector1_lat_7_,transform=ccrs.PlateCarree(),c=sector1_loc_7_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_8_,sector1_lat_8_,transform=ccrs.PlateCarree(),c=sector1_loc_8_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_9_,sector1_lat_9_,transform=ccrs.PlateCarree(),c=sector1_loc_9_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_10,sector1_lat_10,transform=ccrs.PlateCarree(),c=sector1_loc_10,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_11,sector1_lat_11,transform=ccrs.PlateCarree(),c=sector1_loc_11,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_12,sector1_lat_12,transform=ccrs.PlateCarree(),c=sector1_loc_12,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_13,sector1_lat_13,transform=ccrs.PlateCarree(),c=sector1_loc_13,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_14,sector1_lat_14,transform=ccrs.PlateCarree(),c=sector1_loc_14,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_15,sector1_lat_15,transform=ccrs.PlateCarree(),c=sector1_loc_15,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_16,sector1_lat_16,transform=ccrs.PlateCarree(),c=sector1_loc_16,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_17,sector1_lat_17,transform=ccrs.PlateCarree(),c=sector1_loc_17,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_18,sector1_lat_18,transform=ccrs.PlateCarree(),c=sector1_loc_18,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_19,sector1_lat_19,transform=ccrs.PlateCarree(),c=sector1_loc_19,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_20,sector1_lat_20,transform=ccrs.PlateCarree(),c=sector1_loc_20,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_21,sector1_lat_21,transform=ccrs.PlateCarree(),c=sector1_loc_21,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_22,sector1_lat_22,transform=ccrs.PlateCarree(),c=sector1_loc_22,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_23,sector1_lat_23,transform=ccrs.PlateCarree(),c=sector1_loc_23,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_24,sector1_lat_24,transform=ccrs.PlateCarree(),c=sector1_loc_24,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_25,sector1_lat_25,transform=ccrs.PlateCarree(),c=sector1_loc_25,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_26,sector1_lat_26,transform=ccrs.PlateCarree(),c=sector1_loc_26,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax1.scatter(sector1_lon_27,sector1_lat_27,transform=ccrs.PlateCarree(),c=sector1_loc_27,vmin=0,vmax=24,cmap='hsv',marker='.')
    
    
    
    subsolarlongitude=150
    
    ax2 = plt.subplot(ynum,              6,              ypos+4,projection=ccrs.Orthographic(360-cml,              js))
    
    
    ssl_step=int(subsolarlongitude/10)
    crs = ccrs.RotatedPole(globe=ccrs.Globe(flattening=(0.0)))
    ax2 = plt.axes(projection=ccrs.Orthographic(360-cml,              js))
    
    # ax2.set_global()
    # ax2.add_feature(jup_night(subsolarlat,360-subsolarlongitude,              alpha=0.2))
    
    gl = ax2.gridlines(crs=ccrs.PlateCarree(),              linewidth=1,              color='black',              alpha=0.5,              linestyle='dotted',              draw_labels=True)
    # gl.xlocator = mticker.FixedLocator(np.arange(18)*20-180)
    # gl.ylocator = mticker.FixedLocator(np.arange(9)*20-90)
    
    
    ax2.scatter(sector2_lon_0_,sector2_lat_0_,transform=ccrs.PlateCarree(),c=sector2_loc_0_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_1_,sector2_lat_1_,transform=ccrs.PlateCarree(),c=sector2_loc_1_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_2_,sector2_lat_2_,transform=ccrs.PlateCarree(),c=sector2_loc_2_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_3_,sector2_lat_3_,transform=ccrs.PlateCarree(),c=sector2_loc_3_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_4_,sector2_lat_4_,transform=ccrs.PlateCarree(),c=sector2_loc_4_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_5_,sector2_lat_5_,transform=ccrs.PlateCarree(),c=sector2_loc_5_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_6_,sector2_lat_6_,transform=ccrs.PlateCarree(),c=sector2_loc_6_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_7_,sector2_lat_7_,transform=ccrs.PlateCarree(),c=sector2_loc_7_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_8_,sector2_lat_8_,transform=ccrs.PlateCarree(),c=sector2_loc_8_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_9_,sector2_lat_9_,transform=ccrs.PlateCarree(),c=sector2_loc_9_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_10,sector2_lat_10,transform=ccrs.PlateCarree(),c=sector2_loc_10,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_11,sector2_lat_11,transform=ccrs.PlateCarree(),c=sector2_loc_11,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_12,sector2_lat_12,transform=ccrs.PlateCarree(),c=sector2_loc_12,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_13,sector2_lat_13,transform=ccrs.PlateCarree(),c=sector2_loc_13,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_14,sector2_lat_14,transform=ccrs.PlateCarree(),c=sector2_loc_14,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_15,sector2_lat_15,transform=ccrs.PlateCarree(),c=sector2_loc_15,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_16,sector2_lat_16,transform=ccrs.PlateCarree(),c=sector2_loc_16,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_17,sector2_lat_17,transform=ccrs.PlateCarree(),c=sector2_loc_17,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_18,sector2_lat_18,transform=ccrs.PlateCarree(),c=sector2_loc_18,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_19,sector2_lat_19,transform=ccrs.PlateCarree(),c=sector2_loc_19,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_20,sector2_lat_20,transform=ccrs.PlateCarree(),c=sector2_loc_20,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_21,sector2_lat_21,transform=ccrs.PlateCarree(),c=sector2_loc_21,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_22,sector2_lat_22,transform=ccrs.PlateCarree(),c=sector2_loc_22,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_23,sector2_lat_23,transform=ccrs.PlateCarree(),c=sector2_loc_23,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_24,sector2_lat_24,transform=ccrs.PlateCarree(),c=sector2_loc_24,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_25,sector2_lat_25,transform=ccrs.PlateCarree(),c=sector2_loc_25,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_26,sector2_lat_26,transform=ccrs.PlateCarree(),c=sector2_loc_26,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax2.scatter(sector2_lon_27,sector2_lat_27,transform=ccrs.PlateCarree(),c=sector2_loc_27,vmin=0,vmax=24,cmap='hsv',marker='.')
    
    # plt.show()
    
    subsolarlongitude=180
    
    ax3 = plt.subplot(ynum,              6,              ypos+3,projection=ccrs.Orthographic(360-cml,              js))
    
    
    ssl_step=int(subsolarlongitude/10)
    crs = ccrs.RotatedPole(globe=ccrs.Globe(flattening=(0.0)))
    # ax3 = plt.axes(projection=ccrs.Orthographic(360-cml,              js))
    
    # ax.set_global()
    # ax.add_feature(jup_night(subsolarlat,360-subsolarlongitude,              alpha=0.2))
    
    gl = ax3.gridlines(crs=ccrs.PlateCarree(),              linewidth=1,              color='black',              alpha=0.5,              linestyle='dotted',              draw_labels=True)
    # gl.xlocator = mticker.FixedLocator(np.arange(18)*20-180)
    # gl.ylocator = mticker.FixedLocator(np.arange(9)*20-90)
    
    ax3.scatter(sector3_lon_0_,sector3_lat_0_,transform=ccrs.PlateCarree(),c=sector3_loc_0_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_1_,sector3_lat_1_,transform=ccrs.PlateCarree(),c=sector3_loc_1_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_2_,sector3_lat_2_,transform=ccrs.PlateCarree(),c=sector3_loc_2_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_3_,sector3_lat_3_,transform=ccrs.PlateCarree(),c=sector3_loc_3_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_4_,sector3_lat_4_,transform=ccrs.PlateCarree(),c=sector3_loc_4_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_5_,sector3_lat_5_,transform=ccrs.PlateCarree(),c=sector3_loc_5_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_6_,sector3_lat_6_,transform=ccrs.PlateCarree(),c=sector3_loc_6_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_7_,sector3_lat_7_,transform=ccrs.PlateCarree(),c=sector3_loc_7_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_8_,sector3_lat_8_,transform=ccrs.PlateCarree(),c=sector3_loc_8_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_9_,sector3_lat_9_,transform=ccrs.PlateCarree(),c=sector3_loc_9_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_10,sector3_lat_10,transform=ccrs.PlateCarree(),c=sector3_loc_10,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_11,sector3_lat_11,transform=ccrs.PlateCarree(),c=sector3_loc_11,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_12,sector3_lat_12,transform=ccrs.PlateCarree(),c=sector3_loc_12,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_13,sector3_lat_13,transform=ccrs.PlateCarree(),c=sector3_loc_13,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_14,sector3_lat_14,transform=ccrs.PlateCarree(),c=sector3_loc_14,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_15,sector3_lat_15,transform=ccrs.PlateCarree(),c=sector3_loc_15,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_16,sector3_lat_16,transform=ccrs.PlateCarree(),c=sector3_loc_16,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_17,sector3_lat_17,transform=ccrs.PlateCarree(),c=sector3_loc_17,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_18,sector3_lat_18,transform=ccrs.PlateCarree(),c=sector3_loc_18,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_19,sector3_lat_19,transform=ccrs.PlateCarree(),c=sector3_loc_19,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_20,sector3_lat_20,transform=ccrs.PlateCarree(),c=sector3_loc_20,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_21,sector3_lat_21,transform=ccrs.PlateCarree(),c=sector3_loc_21,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_22,sector3_lat_22,transform=ccrs.PlateCarree(),c=sector3_loc_22,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_23,sector3_lat_23,transform=ccrs.PlateCarree(),c=sector3_loc_23,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_24,sector3_lat_24,transform=ccrs.PlateCarree(),c=sector3_loc_24,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_25,sector3_lat_25,transform=ccrs.PlateCarree(),c=sector3_loc_25,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_26,sector3_lat_26,transform=ccrs.PlateCarree(),c=sector3_loc_26,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax3.scatter(sector3_lon_27,sector3_lat_27,transform=ccrs.PlateCarree(),c=sector3_loc_27,vmin=0,vmax=24,cmap='hsv',marker='.')
    
    # plt.show()
    
    subsolarlongitude=210
    
    ax4 = plt.subplot(ynum,              6,              ypos+2,projection=ccrs.Orthographic(360-cml,              js))
    
    ssl_step=int(subsolarlongitude/10)
    crs = ccrs.RotatedPole(globe=ccrs.Globe(flattening=(0.0)))
    # ax = plt.axes(projection=ccrs.Orthographic(360-cml,              js))
    
    # ax.set_global()
    # ax.add_feature(jup_night(subsolarlat,360-subsolarlongitude,              alpha=0.2))
    
    gl = ax4.gridlines(crs=ccrs.PlateCarree(),              linewidth=1,              color='black',              alpha=0.5,              linestyle='dotted',              draw_labels=True)
    # gl.xlocator = mticker.FixedLocator(np.arange(18)*20-180)
    # gl.ylocator = mticker.FixedLocator(np.arange(9)*20-90)
    
    
    ax4.scatter(sector4_lon_0_,sector4_lat_0_,transform=ccrs.PlateCarree(),c=sector4_loc_0_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_1_,sector4_lat_1_,transform=ccrs.PlateCarree(),c=sector4_loc_1_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_2_,sector4_lat_2_,transform=ccrs.PlateCarree(),c=sector4_loc_2_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_3_,sector4_lat_3_,transform=ccrs.PlateCarree(),c=sector4_loc_3_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_4_,sector4_lat_4_,transform=ccrs.PlateCarree(),c=sector4_loc_4_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_5_,sector4_lat_5_,transform=ccrs.PlateCarree(),c=sector4_loc_5_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_6_,sector4_lat_6_,transform=ccrs.PlateCarree(),c=sector4_loc_6_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_7_,sector4_lat_7_,transform=ccrs.PlateCarree(),c=sector4_loc_7_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_8_,sector4_lat_8_,transform=ccrs.PlateCarree(),c=sector4_loc_8_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_9_,sector4_lat_9_,transform=ccrs.PlateCarree(),c=sector4_loc_9_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_10,sector4_lat_10,transform=ccrs.PlateCarree(),c=sector4_loc_10,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_11,sector4_lat_11,transform=ccrs.PlateCarree(),c=sector4_loc_11,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_12,sector4_lat_12,transform=ccrs.PlateCarree(),c=sector4_loc_12,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_13,sector4_lat_13,transform=ccrs.PlateCarree(),c=sector4_loc_13,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_14,sector4_lat_14,transform=ccrs.PlateCarree(),c=sector4_loc_14,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_15,sector4_lat_15,transform=ccrs.PlateCarree(),c=sector4_loc_15,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_16,sector4_lat_16,transform=ccrs.PlateCarree(),c=sector4_loc_16,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_17,sector4_lat_17,transform=ccrs.PlateCarree(),c=sector4_loc_17,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_18,sector4_lat_18,transform=ccrs.PlateCarree(),c=sector4_loc_18,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_19,sector4_lat_19,transform=ccrs.PlateCarree(),c=sector4_loc_19,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_20,sector4_lat_20,transform=ccrs.PlateCarree(),c=sector4_loc_20,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_21,sector4_lat_21,transform=ccrs.PlateCarree(),c=sector4_loc_21,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_22,sector4_lat_22,transform=ccrs.PlateCarree(),c=sector4_loc_22,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_23,sector4_lat_23,transform=ccrs.PlateCarree(),c=sector4_loc_23,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_24,sector4_lat_24,transform=ccrs.PlateCarree(),c=sector4_loc_24,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_25,sector4_lat_25,transform=ccrs.PlateCarree(),c=sector4_loc_25,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_26,sector4_lat_26,transform=ccrs.PlateCarree(),c=sector4_loc_26,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax4.scatter(sector4_lon_27,sector4_lat_27,transform=ccrs.PlateCarree(),c=sector4_loc_27,vmin=0,vmax=24,cmap='hsv',marker='.')
    
    # plt.show()
    
    subsolarlongitude=240
    
    ax5 = plt.subplot(ynum,              6,              ypos+1,projection=ccrs.Orthographic(360-cml,              js))
    
    ssl_step=int(subsolarlongitude/10)
    crs = ccrs.RotatedPole(globe=ccrs.Globe(flattening=(0.0)))
    # ax = plt.axes(projection=ccrs.Orthographic(360-cml,              js))
    
    # ax.set_global()
    # ax.add_feature(jup_night(subsolarlat,360-subsolarlongitude,              alpha=0.2))
    
    gl = ax5.gridlines(crs=ccrs.PlateCarree(),              linewidth=1,              color='black',              alpha=0.5,              linestyle='dotted',              draw_labels=True)
    # gl.xlocator = mticker.FixedLocator(np.arange(18)*20-180)
    # gl.ylocator = mticker.FixedLocator(np.arange(9)*20-90)
    
    
    cc=ax5.scatter(sector5_lon_0_,sector5_lat_0_,transform=ccrs.PlateCarree(),c=sector5_loc_0_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_1_,sector5_lat_1_,transform=ccrs.PlateCarree(),c=sector5_loc_1_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_2_,sector5_lat_2_,transform=ccrs.PlateCarree(),c=sector5_loc_2_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_3_,sector5_lat_3_,transform=ccrs.PlateCarree(),c=sector5_loc_3_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_4_,sector5_lat_4_,transform=ccrs.PlateCarree(),c=sector5_loc_4_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_5_,sector5_lat_5_,transform=ccrs.PlateCarree(),c=sector5_loc_5_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_6_,sector5_lat_6_,transform=ccrs.PlateCarree(),c=sector5_loc_6_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_7_,sector5_lat_7_,transform=ccrs.PlateCarree(),c=sector5_loc_7_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_8_,sector5_lat_8_,transform=ccrs.PlateCarree(),c=sector5_loc_8_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_9_,sector5_lat_9_,transform=ccrs.PlateCarree(),c=sector5_loc_9_,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_10,sector5_lat_10,transform=ccrs.PlateCarree(),c=sector5_loc_10,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_11,sector5_lat_11,transform=ccrs.PlateCarree(),c=sector5_loc_11,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_12,sector5_lat_12,transform=ccrs.PlateCarree(),c=sector5_loc_12,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_13,sector5_lat_13,transform=ccrs.PlateCarree(),c=sector5_loc_13,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_14,sector5_lat_14,transform=ccrs.PlateCarree(),c=sector5_loc_14,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_15,sector5_lat_15,transform=ccrs.PlateCarree(),c=sector5_loc_15,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_16,sector5_lat_16,transform=ccrs.PlateCarree(),c=sector5_loc_16,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_17,sector5_lat_17,transform=ccrs.PlateCarree(),c=sector5_loc_17,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_18,sector5_lat_18,transform=ccrs.PlateCarree(),c=sector5_loc_18,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_19,sector5_lat_19,transform=ccrs.PlateCarree(),c=sector5_loc_19,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_20,sector5_lat_20,transform=ccrs.PlateCarree(),c=sector5_loc_20,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_21,sector5_lat_21,transform=ccrs.PlateCarree(),c=sector5_loc_21,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_22,sector5_lat_22,transform=ccrs.PlateCarree(),c=sector5_loc_22,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_23,sector5_lat_23,transform=ccrs.PlateCarree(),c=sector5_loc_23,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_24,sector5_lat_24,transform=ccrs.PlateCarree(),c=sector5_loc_24,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_25,sector5_lat_25,transform=ccrs.PlateCarree(),c=sector5_loc_25,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_26,sector5_lat_26,transform=ccrs.PlateCarree(),c=sector5_loc_26,vmin=0,vmax=24,cmap='hsv',marker='.')
    ax5.scatter(sector5_lon_27,sector5_lat_27,transform=ccrs.PlateCarree(),c=sector5_loc_27,vmin=0,vmax=24,cmap='hsv',marker='.')
    
    
    ax6 = plt.subplot(ynum,              6,              ypos+6)
    ax6.axis('off')
    
    fig.colorbar(cc,ax=ax6)
    

    return



if runhere:

    fig,((ax21,ax22,ax23,ax24,a2x5,a2x6),(a1x1,a1x2,a1x3,a1x4,ax15,ax16),(ax1,ax2,ax3,ax4,ax5,ax6)) = plt.subplots(3,              6,              gridspec_kw={'width_ratios': [1,1,1,1,1,              0.3]})
    
    
    fig.set_figwidth(11)
    fig.set_figheight(6)
    fig.set_dpi(300)
    
    plot_vogt_slices(3,1)
    plt.show()
    # usage
    
    # In[7]
    
    
    ofl_lat,ofl_lon=vogt_ofl()
    
    
    ofl_loc=np.zeros_like(ofl_lat)
    
    
    sys.path.insert(0,              '../../tss')
    from basic.polygonmask import maskeqvalue
    
    
    np_0__lon2=north_plotting[2,:,3]
    np_0__lat2=north_plotting[2,:,2]
    np_0__loc2=north_plotting[2,:,1]
    
    
    fit_xmo,fit_ymo=fit_fieldline_fixed(np_0__lon2,np_0__lat2) 
    fitx,fity = fit_fieldline_scattered(ofl_lon,ofl_lat,sigma=6)
    
    
    ofl_loc=maskeqvalue(ofl_lat,ofl_lon,ofl_loc,fitx,fity,setvalue=1.)
    
    
    
    
    crs = ccrs.RotatedPole(globe=ccrs.Globe(flattening=(0.0)))
    ax = plt.axes(projection=ccrs.Orthographic(360-cml,              80))
    
    ax.set_global()
    ax.add_feature(jup_night(subsolarlat,360-subsolarlongitude,              alpha=0.2))
    
    gl = ax.gridlines(crs=ccrs.PlateCarree(),              linewidth=1,              color='black',              alpha=0.5,              linestyle='dotted',              draw_labels=True)
    gl.xlocator = mticker.FixedLocator(np.arange(18)*20-180)
    gl.ylocator = mticker.FixedLocator(np.arange(9)*20-90)
    
    
    plt.scatter(np_0__lon2,np_0__lat2,transform=ccrs.PlateCarree(),c=np_0__loc2,vmin=0,vmax=24,cmap='hsv',marker='.')
    plt.plot(fity,fitx,transform=ccrs.PlateCarree(),c='r')
    
    # plt.scatter(ofl_lon,ofl_lat,marker='.',transform=ccrs.PlateCarree(),linewidth=0.01)
    plt.scatter(ofl_lon,ofl_lat,c=ofl_loc,marker='.',transform=ccrs.PlateCarree(),linewidth=0.01)
    plt.plot(fit_xmo,fit_ymo,transform=ccrs.PlateCarree(),c='r')
    
    
    
    
    plt.figure()
    plt.scatter(ofl_lon,ofl_lat,c=ofl_loc,marker='.',linewidth=0.01)
    plt.plot(fity,fitx,c='r')
    plt.show()
    





